添加分类页标题
This commit is contained in:
parent
8b0a8cad83
commit
39cd560780
3 changed files with 13 additions and 4 deletions
|
@ -22,7 +22,7 @@
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
{{ safeHTML (.Scratch.Get `firstEmoji`) }}
|
{{ safeHTML (.Scratch.Get `firstEmoji`) }}
|
||||||
<a href="{{ .Permalink }}"><h2 class="post-title">{{ .Title }}</h2></a>
|
<a href="{{ .Permalink }}"><h2 class="post-title">{{ .Title }}</h2></a>
|
||||||
<p class="post-meta">{{ .Date.Format "Jan 2, 2006" }} .
|
<p class="post-meta">{{ .Date.Format "Jan 2, 2006" }} ·
|
||||||
{{ with .Params.categories }}
|
{{ with .Params.categories }}
|
||||||
{{ $categoriesLen := len . }}
|
{{ $categoriesLen := len . }}
|
||||||
{{ if gt $categoriesLen 0 }}
|
{{ if gt $categoriesLen 0 }}
|
||||||
|
|
|
@ -5,8 +5,16 @@
|
||||||
<p class="post-meta">
|
<p class="post-meta">
|
||||||
{{- if or .Params.author .Site.Params.author -}}
|
{{- if or .Params.author .Site.Params.author -}}
|
||||||
{{ .Params.author | default .Site.Params.author }} · {{ end }}
|
{{ .Params.author | default .Site.Params.author }} · {{ end }}
|
||||||
{{- .Date.Format "Jan 2, 2006" -}}
|
{{- .Date.Format "Jan 2, 2006" -}} ·
|
||||||
|
{{ with .Params.categories }}
|
||||||
|
{{ $categoriesLen := len . }}
|
||||||
|
{{ if gt $categoriesLen 0 }}
|
||||||
|
<span>{{ i18n "post.categorized_in" }}</span>
|
||||||
|
{{ range $k, $v := . }}
|
||||||
|
<a class="category-link" href="{{ . | printf "%s%s" "/categories/" | urlize | lower | relLangURL }}">{{ . }}</a>{{ if lt $k (sub $categoriesLen 1) }}, {{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<div class="post-content">{{ .Content }}</div>
|
<div class="post-content">{{ .Content }}</div>
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
{{- if not .IsHome }}
|
{{- if not .IsHome }}
|
||||||
{{- if eq .Kind "page" }}{{ .Title }}
|
{{- if eq .Kind "page" }}{{ .Title }}
|
||||||
{{- else if eq .Data.Singular "tag" }}{{ .Data.Term }}
|
{{- else if eq .Data.Singular "tag" }}{{ .Data.Term }}
|
||||||
{{- else }}Posts
|
{{- else }}
|
||||||
|
{{ with .Title }}{{ . }}{{ end }}
|
||||||
{{- end }} - {{ end }}
|
{{- end }} - {{ end }}
|
||||||
{{- .Site.Title -}}
|
{{- .Site.Title -}}
|
||||||
</title>
|
</title>
|
||||||
|
|
Loading…
Reference in a new issue