mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-17 13:25:57 -06:00
Update post-metadata to use a partial, and add word count
This commit is contained in:
parent
4dc429ce5d
commit
c8874736ea
@ -29,8 +29,12 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.wordcount {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.tags {
|
||||
margin-left: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
|
@ -3,35 +3,7 @@
|
||||
<h1>{{ .Title | markdownify }}</h1>
|
||||
</div>
|
||||
|
||||
{{ if or .Date (.GetTerms "tags") }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
|
||||
<span class="date">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
|
||||
{{ if ne .Lastmod .Date }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
(Modified {{ .Lastmod.Format "January 2, 2006" }})
|
||||
</time>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
<span class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="tag">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ partial "post-metadata.html" . }}
|
||||
|
||||
{{ if .Params.Toc }}
|
||||
<div id="table-of-contents">
|
||||
|
@ -3,35 +3,7 @@
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</h2>
|
||||
|
||||
{{ if or .Date (.GetTerms "tags") }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
|
||||
<span class="date">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "January 2, 2006" }}" pubdate>
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
|
||||
{{ if ne .Lastmod .Date }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
(Modified {{ .Lastmod.Format "January 2, 2006" }})
|
||||
</time>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
<span class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="tag">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ partial "post-metadata.html" . }}
|
||||
|
||||
{{ with .Resources.GetMatch "feature" }}
|
||||
{{ if eq .MediaType.MainType "image" }}
|
||||
|
34
layouts/partials/post-metadata.html
Normal file
34
layouts/partials/post-metadata.html
Normal file
@ -0,0 +1,34 @@
|
||||
{{ if or .Date (.GetTerms "tags") }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
|
||||
<span class="date">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "January 2, 2006" }}" pubdate>
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
|
||||
{{ if ne .Lastmod .Date }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
(Modified {{ .Lastmod.Format "January 2, 2006" }})
|
||||
</time>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</span>
|
||||
|
||||
<span class="wordcount">
|
||||
{{ partial "icon.html" "type" }}
|
||||
{{ .WordCount }} words
|
||||
</span>
|
||||
|
||||
<div class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="tag">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Reference in New Issue
Block a user