mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 12:03:31 +08:00
move categories to components
This commit is contained in:
parent
325303a7f8
commit
63dd8879b3
9
layouts/partials/article/components/categories.html
Normal file
9
layouts/partials/article/components/categories.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{{ if .Params.categories }}
|
||||||
|
<section class="article-category">
|
||||||
|
{{ range (.GetTerms "categories") }}
|
||||||
|
<a href="{{ .RelPermalink }}" {{ with .Params.style }}style="background-color: {{ .background }}; color: {{ .color }};"{{ end }}>
|
||||||
|
{{ .LinkTitle }}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
</section>
|
||||||
|
{{ end }}
|
@ -1,13 +1,5 @@
|
|||||||
<div class="article-details">
|
<div class="article-details">
|
||||||
{{ if .Params.categories }}
|
{{ partial "article/components/categories" . }}
|
||||||
<header class="article-category">
|
|
||||||
{{ range (.GetTerms "categories") }}
|
|
||||||
<a href="{{ .RelPermalink }}" {{ with .Params.style }}style="background-color: {{ .background }}; color: {{ .color }};"{{ end }}>
|
|
||||||
{{ .LinkTitle }}
|
|
||||||
</a>
|
|
||||||
{{ end }}
|
|
||||||
</header>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<h2 class="article-title">
|
<h2 class="article-title">
|
||||||
<a href="{{ .RelPermalink }}">
|
<a href="{{ .RelPermalink }}">
|
||||||
|
Loading…
Reference in New Issue
Block a user