Commit 9dbd05ac authored by Kaushal Modi's avatar Kaushal Modi

Replace post_categories.html and post_tags.html with post_taxo.html

parent 893f9f1d
......@@ -56,10 +56,8 @@
</div>
</div>
<div class="post-catlist right">
{{ partial "post_categories.html" . }}
{{ partial "post_tags.html" . }}
</div>
<!-- Tags/categories -->
{{ partial "post_taxo.html" . }}
</div>
{{ end }}
......
<div class="catlist no-color-links">
{{ if .Params.categories }}
{{ $count := len .Params.categories }}
{{ if gt $count 0 }}
&nbsp;
<i class="{{ .Param "fontawesome.style" | default "fal" }} fa-list-alt"></i>&nbsp;&nbsp;
{{ range $k, $v := .Params.categories }}
<a class="p-category" href="/categories/{{ . | urlize }}">{{ . }}</a>
{{ if lt $k (sub $count 1) }}
,
{{ end }}
{{ end }}
{{ end }}
<!-- Older implementation -->
<!-- <i class="fal fa-list-alt"></i> -->
{{/* range .Params.categories */}}
<!-- <li><a href="/categories/{{ . | urlize }}">{{ . }}</a> </li> -->
{{/* end */}}
{{ end }}
</div>
<div class="catlist no-color-links">
{{ if .Params.tags }}
{{ $count := len .Params.tags }}
{{ if gt $count 0 }}
&nbsp;
<i class="{{ .Param "fontawesome.style" | default "fal" }} fa-tags"></i>&nbsp;&nbsp;
{{ range $k, $v := .Params.tags }}
<a class="p-category" href="/tags/{{ . | urlize }}">{{ . }}</a>
{{ if lt $k (sub $count 1) }}
,
{{ end }}
{{ end }}
{{ end }}
<!-- Older implementation -->
<!-- <i class="fal fa-tags"></i> -->
{{/* range .Params.tags */}}
<!-- <li><a href="/tags/{{ . | urlize }}">{{ . }}</a> </li> -->
{{/* end */}}
{{ end }}
</div>
{{ $taxo_map := (dict "tags" (dict "icon" "fa-tags") "categories" (dict "icon" "fa-list-alt")) }}
<div class="post-taxo right no-color-links">
{{ range $key, $val := $taxo_map }}
{{ with $.Page.Param $key }}
<div>
{{ $taxo_list := . }}
{{ $count := len $taxo_list }}
{{ if gt $count 0 }}
&nbsp;
<i class="{{ $.Param "fontawesome.style" | default "fal" }} {{ index $val "icon" }}"></i>&nbsp;&nbsp;
{{ range $cnt, $taxo_term := $taxo_list }}
<a class="p-category" href="/{{ $key }}/{{ $taxo_term | urlize }}">{{ $taxo_term }}</a>
{{ if lt $cnt (sub $count 1) }}
,
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment