Browse Source

tweaking category display for omitted categories

master
Jon Kelbie 5 months ago
parent
commit
45fffb03b8
  1. 2
      themes/nipponalba/layouts/_default/section.html
  2. 2
      themes/nipponalba/layouts/_default/section.jp.html
  3. 2
      themes/nipponalba/layouts/_default/single.html
  4. 2
      themes/nipponalba/layouts/_default/single.jp.html
  5. 2
      themes/nipponalba/layouts/partials/taxonomy/categories.html

2
themes/nipponalba/layouts/_default/section.html

@ -30,7 +30,7 @@
{{end}}
</section><br/>
{{ if not (eq .Type "article") }}<section class="info">
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span><br/>
<span class="categories_span">{{ with .Page.Params.category }}{{ $arr := index ( . ) 0 }}{{ if not ( in (slice "food (vegan)" "alcohol" "covid" "death" "5" "alcohol mention" "food mention") $arr )}} Categories: {{ end }}{{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span><br/>
</section>{{ end }}
</article>
</section>

2
themes/nipponalba/layouts/_default/section.jp.html

@ -34,7 +34,7 @@
{{end}}
</section><br/>
{{ if not (eq .Type "article") }}<section class="info">
<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span><br/>
<span class="categories_span">{{ with .Page.Params.category }}{{ $arr := index ( . ) 0 }}{{ if not ( in (slice "food (vegan)" "alcohol" "covid" "death" "5" "alcohol mention" "food mention") $arr )}} Categories: {{ end }}{{ partial "taxonomy/categories.html" . }}{{ end }}</span><span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span><br/>
</section>{{ end }}
</article>
</section>

2
themes/nipponalba/layouts/_default/single.html

@ -30,7 +30,7 @@
{{ end }}<br/>
</section>
<section class="info">
{{ if not (eq .Type "article") }}<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span>{{ end }}
{{ if not (eq .Type "article") }}<span class="categories_span">{{ with .Page.Params.category }}{{ $arr := index ( . ) 0 }}{{ if not ( in (slice "food (vegan)" "alcohol" "covid" "death" "5" "alcohol mention" "food mention") $arr )}} Categories: {{ end }}{{ partial "taxonomy/categories.html" . }}{{ end }}</span>{{ end }}
<span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span></section>
<hr/>

2
themes/nipponalba/layouts/_default/single.jp.html

@ -34,7 +34,7 @@
{{ end }}<br/>
</section>
<section class="info">
{{ if not (eq .Type "article") }}<span class="categories_span">{{ with .Page.Params.category }}Categories: {{ partial "taxonomy/categories.html" . }}{{ end }}</span>{{ end }}
{{ if not (eq .Type "article") }}<span class="categories_span">{{ with .Page.Params.category }}{{ $arr := index ( . ) 0 }}{{ if not ( in (slice "food (vegan)" "alcohol" "covid" "death" "5" "alcohol mention" "food mention") $arr )}} Categories: {{ end }}{{ partial "taxonomy/categories.html" . }}{{ end }}</span>{{ end }}
<span class="info-date"><a href="{{ .Permalink }}" class="u-url"><time class="dt-published" datetime="{{ .Date.Format "2 Jan 2006 15:04 GMT" }}">{{ .Date.Format "02/01/2006 15:04 GMT" }}</time></a></span></section>
<hr/>

2
themes/nipponalba/layouts/partials/taxonomy/categories.html

@ -1,6 +1,6 @@
<ul class="categories">
{{- range $index, $el := . -}}
{{if not (in (slice "food (vegan)" "alcohol" "covid" "death" "5") .)}}<li><a class="category p-category" href="{{ ( printf "category/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a></li>{{ end }}
{{if not (in (slice "food (vegan)" "alcohol" "covid" "death" "5" "alcohol mention" "food mention") .)}}<li><a class="category p-category" href="{{ ( printf "category/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a></li>{{ end }}
{{- end -}}
</ul>
Loading…
Cancel
Save