move categories to components

This commit is contained in:
m9810223 2021-05-19 23:05:21 +08:00
parent 325303a7f8
commit 63dd8879b3
No known key found for this signature in database
GPG Key ID: 55B097D2E5470A87
2 changed files with 10 additions and 9 deletions

View 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 }}

View File

@ -1,13 +1,5 @@
<div class="article-details">
{{ if .Params.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 }}
{{ partial "article/components/categories" . }}
<h2 class="article-title">
<a href="{{ .RelPermalink }}">