Skip to content

Commit

Permalink
Modified templates for Chinese section titles
Browse files Browse the repository at this point in the history
  • Loading branch information
F Y committed Mar 26, 2021
1 parent ff21e72 commit 36a8307
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
19 changes: 17 additions & 2 deletions themes/hugo-prose/layouts/_default/list.html
Expand Up @@ -3,7 +3,13 @@
<div class="container list">
<main>
{{ if not .IsHome }}
<h1>{{ .Title }}</h1>
<h1>
{{ if eq .Title "Posts" }}
文章
{{ else }}
{{ .Title }}
{{ end }}
</h1>
{{ end }}

{{ with .Content }}
Expand Down Expand Up @@ -50,7 +56,16 @@ <h1><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
</td>
{{ if $.IsHome }}
<td class="spacer spacer-right"></td>
<td class="side-title">{{ with .Section }}<h1><a href="{{ print "/" . "/" | relURL }}">{{ . }}</a></h1>{{ end }}</td>
<td class="side-title">{{ with .Section }}
{{ if (eq . "post") }}
<h1 style="writing-mode: vertical-rl; transform: rotate(-90deg);"><a href="{{ print "/" . "/" | relURL }}"> 文章
{{ else }}
<h1><a href="{{ print "/" . "/" | relURL }}">{{ . }}
{{ end }}
</a></h1>
{{ end }}
</td>

{{ end }}
</tr>
</tbody>
Expand Down
10 changes: 9 additions & 1 deletion themes/hugo-prose/layouts/_default/sitemap.html
Expand Up @@ -8,7 +8,15 @@ <h1>{{ .Title }}</h1>

{{ range .Site.RegularPages.GroupBy "Section" }}
<section class="article-list normal-card">
<h2 class="archive-title"><a href="{{ print "/" .Key "/" | relURL }}">{{ .Key | pluralize | title }}</a></h2>
<h2 class="archive-title"><a href="{{ print "/" .Key "/" | relURL }}">
{{ if (eq .Key "post") }}
文章
{{ else if (eq .Key "card") }}
作者
{{ else }}
{{ .Key | pluralize | title }}
{{ end }}
</a></h2>
<ul>
{{ range sort .Pages "Date" "desc" }}
<li>
Expand Down

0 comments on commit 36a8307

Please sign in to comment.