mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
Support categories
parameter for posts (#73)
This commit is contained in:
parent
ae3a757777
commit
7901d14d75
2 changed files with 15 additions and 1 deletions
|
@ -8,13 +8,26 @@
|
||||||
</time>
|
</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
{{ if isset $.Params "categories" }}
|
||||||
|
{{ $categoriesLen := len $.Params.categories }}
|
||||||
|
{{ if gt $categoriesLen 0 }}
|
||||||
|
<span class="article-categories">
|
||||||
|
<i class="fa fa-folder"></i>
|
||||||
|
{{ range $k, $v := $.Params.categories }}
|
||||||
|
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize | lower }}">{{ . }}</a
|
||||||
|
>{{ if lt $k (sub $categoriesLen 1) }}, {{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ if isset $.Params "tags" }}
|
{{ if isset $.Params "tags" }}
|
||||||
{{ $tagsLen := len $.Params.tags }}
|
{{ $tagsLen := len $.Params.tags }}
|
||||||
{{ if gt $tagsLen 0 }}
|
{{ if gt $tagsLen 0 }}
|
||||||
<span class="article-tags">
|
<span class="article-tags">
|
||||||
<i class="fa fa-tags"></i>
|
<i class="fa fa-tags"></i>
|
||||||
{{ range $k, $v := $.Params.tags }}
|
{{ range $k, $v := $.Params.tags }}
|
||||||
<a class="article-tag-link" href="{{ $.Site.BaseURL }}tags/{{ . | urlize | lower }}">{{ . }}</a
|
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize | lower }}">{{ . }}</a
|
||||||
>{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
|
>{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -403,6 +403,7 @@ article {
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-metadata .article-date,
|
.article-metadata .article-date,
|
||||||
|
.article-metadata .article-categories,
|
||||||
.article-metadata .article-tags {
|
.article-metadata .article-tags {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue