mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-11 12:11:45 +00:00
Support categories parameter for posts (#73)
This commit is contained in:
1 parent
ae3a757777
commit
7901d14d75
2 files changed
+15
-1
No files matched your search
@@ -8,13 +8,26 @@
|
||||
</time>
|
||||
</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" }}
|
||||
{{ $tagsLen := len $.Params.tags }}
|
||||
{{ if gt $tagsLen 0 }}
|
||||
<span class="article-tags">
|
||||
<i class="fa fa-tags"></i>
|
||||
{{ 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 }}
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
@@ -403,6 +403,7 @@ article {
|
||||
}
|
||||
|
||||
.article-metadata .article-date,
|
||||
.article-metadata .article-categories,
|
||||
.article-metadata .article-tags {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user