diff options
| -rw-r--r-- | layouts/_default/single.html | 43 | ||||
| -rw-r--r-- | layouts/archives/single.html | 64 |
2 files changed, 53 insertions, 54 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2f71bdc..96b3bb0 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,32 +1,35 @@ {{ define "main" }} <header> - <a href=/>回到首页</a> + <a href= /><code>cd ~</code></a> </header> <hr> - <article> - <header> - <h1>{{ .Title }}</h1> - <div class=meta> - <time datetime={{ .Date.Format "2006-01-02T15:04:05Z07:00" }}>{{ .Date.Format "2006-01-02" }}</time> - {{ with .Params.categories }} - <span class=cats>[ - {{- range $index, $cat := . -}} - {{- if $index }} · {{ end -}}<a href=/categories/{{ $cat | urlize }}/>{{ $cat }}</a> - {{- end -}} - ]</span> - {{ end }} - </div> - </header> + <header> + <h1>{{ .Title }}</h1> + {{ if .Params.showMeta }} + <div class=meta> + <time datetime={{ .Date.Format "2006-01-02T15:04:05Z07:00" }}>{{ .Date.Format "2006-01-02" }}</time> + {{ with .Params.categories }} + <span class=cats>[ + {{- range $index, $cat := . -}} + {{- if $index }} · {{ end -}}<a href=/categories/{{ $cat | urlize }} />{{ $cat }}</a> + {{- end -}} + ]</span> + {{ end }} + </div> + {{ end }} + </header> - <div class=body> - {{ .Content }} - </div> + <div class=body> + {{ .Content }} + </div> </article> <hr> <footer> - <p>条目共享:遵循 <a href=https://creativecommons.org/licenses/by-nc-sa/4.0/ rel="license noopener">CC BY-NC-SA 4.0</a> 协议。</p> - <p>交流通道:向 <a href="mailto:im@verdant.ee?subject=回复《{{ .Title }}》">im@verdant.ee</a> 发送一封 <a href=https://useplaintext.email/>纯文本邮件</a>。</p> + <p>条目共享:遵循 <a href=https://creativecommons.org/licenses/by-nc-sa/4.0/ rel="license noopener">CC BY-NC-SA 4.0</a> 协议。 + </p> + <p>交流通道:向 <a href="mailto:im@verdant.ee?subject=回复《{{ .Title }}》">im@verdant.ee</a> 发送一封 <a + href=https://useplaintext.email />纯文本邮件</a>。</p> </footer> {{ end }} diff --git a/layouts/archives/single.html b/layouts/archives/single.html index 83436ac..e7fc884 100644 --- a/layouts/archives/single.html +++ b/layouts/archives/single.html @@ -1,44 +1,40 @@ {{ define "main" }} <header> - <a href={{ "" | relURL }} class=title><p class=site-title>{{ .Site.Title }}</p></a> - <nav>{{ partial "nav.html" . }}</nav> + <a href= /><code>cd ~</code></a> </header> +<hr> <main> - {{ if .Data.Singular }} - <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3> - <small><a href={{ "blog" | relURL }}>Remove filter</a></small> - {{ end }} + {{ if .Data.Singular }} + <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3> + <small><a href={{ "blog" | relURL }}>Remove filter</a></small> + {{ end }} - {{ $allPosts := where .Site.RegularPages "Type" "eq" "posts" }} - {{ $excludePosts := where $allPosts "Params.categories" "intersect" (slice "1") }} - {{ $postPages := ($allPosts | complement $excludePosts) }} + {{ $allPosts := where .Site.RegularPages "Type" "eq" "posts" }} + {{ $excludePosts := where $allPosts "Params.categories" "intersect" (slice "1") }} + {{ $postPages := ($allPosts | complement $excludePosts) }} - <ul class=blog-posts> - {{ $currentYear := 0 }} - {{ range $postPages }} - {{ $year := .Date.Year }} - {{ if ne $year $currentYear }} - <h3>{{ $year }}</h3> - {{ $currentYear = $year }} - {{ end }} - <li> - <time datetime={{ .Date.Format "2006-01-02" }} pubdate>{{ .Date.Format "2006-01-02" }}</time> - <a href={{ .Permalink }}>{{ .Title }}</a> - </li> - {{ else }} - <li>No posts yet</li> - {{ end }} - </ul> + <ul class=blog-posts> + {{ $currentYear := 0 }} + {{ range $postPages }} + {{ $year := .Date.Year }} + <li> + <span class="post-link-wrapper"> + <a href="{{ .RelPermalink }}" class="post-title">{{ .Title }}</a> + </span> - {{ if not .Data.Singular }} - <footer> - <nav class=tags> - {{ range .Site.Taxonomies.tags }} - <a href={{ .Page.Permalink }}>#{{ .Page.Title }}</a> - {{ end }} - </nav> - </footer> - {{ end }} + <time datetime="{{ .Date.Format " 2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time> + </li> + {{ end }} + </ul> + {{ if not .Data.Singular }} + <footer> + <nav class=tags> + {{ range .Site.Taxonomies.tags }} + <a href={{ .Page.Permalink }}>#{{ .Page.Title }}</a> + {{ end }} + </nav> + </footer> + {{ end }} </main> {{ end }} |
