diff options
| author | nsfisis <nsfisis@gmail.com> | 2022-05-14 22:40:28 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2022-05-14 22:40:28 +0900 |
| commit | e2d0028c1fbfb4cac59e20926e5aa0031e0ed607 (patch) | |
| tree | bf89da301d96aaf22aac30402156cd1f3fed8299 /themes/mypaper/layouts/_default | |
| parent | fee09a6d9a16226ea02b2725fff318cc35dd83b7 (diff) | |
| download | nsfisis.github.io-e2d0028c1fbfb4cac59e20926e5aa0031e0ed607.tar.gz nsfisis.github.io-e2d0028c1fbfb4cac59e20926e5aa0031e0ed607.tar.zst nsfisis.github.io-e2d0028c1fbfb4cac59e20926e5aa0031e0ed607.zip | |
add changelog field to frontmatter
Diffstat (limited to 'themes/mypaper/layouts/_default')
| -rw-r--r-- | themes/mypaper/layouts/_default/list.html | 4 | ||||
| -rw-r--r-- | themes/mypaper/layouts/_default/single.html | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/themes/mypaper/layouts/_default/list.html b/themes/mypaper/layouts/_default/list.html index 4840732..053951f 100644 --- a/themes/mypaper/layouts/_default/list.html +++ b/themes/mypaper/layouts/_default/list.html @@ -21,7 +21,9 @@ <p>{{ .Summary | plainify | htmlUnescape }}</p> </section> <footer class="entry-footer"> - <time>{{ .Date.Format "2006-01-02" }}</time> + {{- $date := .Date.Format "2006-01-02" }} + {{- $lastmod := .Lastmod.Format "2006-01-02" }} + Posted on <time>{{ $date }}</time>{{ if ne $date $lastmod }}, updated on <time>{{ $lastmod }}</time>{{ end }} </footer> <a class="entry-link" href="{{ .Permalink }}"></a> </article> diff --git a/themes/mypaper/layouts/_default/single.html b/themes/mypaper/layouts/_default/single.html index 918a3c8..71c6481 100644 --- a/themes/mypaper/layouts/_default/single.html +++ b/themes/mypaper/layouts/_default/single.html @@ -4,9 +4,9 @@ <header class="post-header"> <h1 class="post-title">{{ .Title }}</h1> <div class="post-meta"> - {{- if or .Params.Author .Site.Author.name }} - {{- .Params.Author | default .Site.Author.name }} · {{ end }} - {{- .Date.Format "2006-01-02" -}} + {{- $date := .Date.Format "2006-01-02" }} + {{- $lastmod := .Lastmod.Format "2006-01-02" }} + Posted on <time>{{ $date }}</time>{{ if ne $date $lastmod }}, updated on <time>{{ $lastmod }}</time>{{ end }} </div> {{- if .Params.tags }} <ul class="post-tags"> @@ -17,7 +17,19 @@ </ul> {{- end }} </header> - <div class="post-content">{{ .Content }}</div> + <div class="post-content"> + {{- if .Params.changelog }} + <section> + <h1>更新履歴</h1> + <ul> + {{- range $date, $remark := .Params.changelog }} + <li>{{ $date }}: {{ $remark }}</li> + {{- end }} + </ul> + </section> + {{- end }} + {{ .Content }} + </div> </article> {{- partial "footer.html" . }} |
