1
0
Fork 0

添加文章mate类别显示

This commit is contained in:
indes 2018-04-20 15:27:24 +08:00
parent 4f6555f008
commit 0cf0348320
2 changed files with 13 additions and 6 deletions

View file

@ -18,14 +18,23 @@
<article class="post {{ .Scratch.Get `postClass` }}">
<header class="post-header">
{{ safeHTML (.Scratch.Get `firstEmoji`) }}
<h2 class="post-title">{{ .Title }}</h2>
<p class="post-meta">{{ .Date.Format "Jan 2, 2006" }}</p>
<a href="{{ .Permalink }}"><h2 class="post-title">{{ .Title }}</h2></a>
<p class="post-meta">{{ .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>
</header>
<p class="post-summary">{{ .Summary | plainify | htmlUnescape }}...</p>
<footer class="post-footer">
</footer>
<a class="post-link" href="{{ .Permalink }}"></a>
<!-- <a class="post-link" href="{{ .Permalink }}"></a> -->
</article>
{{ end }}
{{ end }}

View file

@ -1,8 +1,6 @@
</main>
<footer class="footer">
<span>&copy; {{ if eq now.Year 2017 }}2017{{ else }}2017-{{ now.Year }}{{ end }} {{ .Site.Title }} 🎉</span>
<span>&middot;</span>
<span>Powered by <a href="https://gohugo.io/" target="_blank">Hugo❤</a></span>
</footer>
<script src="https://cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant></script>
<script data-no-instant>InstantClick.init();</script>