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

View file

@ -1,8 +1,6 @@
</main> </main>
<footer class="footer"> <footer class="footer">
<span>&copy; {{ if eq now.Year 2017 }}2017{{ else }}2017-{{ now.Year }}{{ end }} {{ .Site.Title }} 🎉</span> <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> </footer>
<script src="https://cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant></script> <script src="https://cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant></script>
<script data-no-instant>InstantClick.init();</script> <script data-no-instant>InstantClick.init();</script>