summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/archive.md4
-rw-r--r--i18n/en.yml1
-rw-r--r--i18n/zh.yml1
-rw-r--r--layouts/_partials/home/latest-posts.html4
-rw-r--r--layouts/archive.html21
5 files changed, 31 insertions, 0 deletions
diff --git a/content/archive.md b/content/archive.md
new file mode 100644
index 00000000..3cb9a942
--- /dev/null
+++ b/content/archive.md
@@ -0,0 +1,4 @@
++++
+title = '归档'
+layout = 'archive'
++++
diff --git a/i18n/en.yml b/i18n/en.yml
index f7bc5db4..8bb3bfc6 100644
--- a/i18n/en.yml
+++ b/i18n/en.yml
@@ -1,4 +1,5 @@
lang: en
+seeArchive: See all pages
archivePage:
postCountMonthly: '{{ . }} POSTS'
postCountAnnual: '{{ . }} TOTAL POSTS'
diff --git a/i18n/zh.yml b/i18n/zh.yml
index d0d69c40..a4e45517 100644
--- a/i18n/zh.yml
+++ b/i18n/zh.yml
@@ -1,4 +1,5 @@
lang: zh-CN
+seeArchive: 查看全部页面
archivePage:
postCountMonthly: '{{ . }} 篇文章'
postCountAnnual: '共计 {{ . }} 篇文章'
diff --git a/layouts/_partials/home/latest-posts.html b/layouts/_partials/home/latest-posts.html
index ac015111..72e3828a 100644
--- a/layouts/_partials/home/latest-posts.html
+++ b/layouts/_partials/home/latest-posts.html
@@ -8,4 +8,8 @@
) }}
{{ $firstPost = false }}
{{ end }}
+ <div>
+ <a class="small-button" href="{{ if eq .Site.Language "zh" }}/archive{{ else }}{{ .Site.LanguagePrefix }}/posts{{ end }}">
+ {{ T "seeArchive" }} →</a>
+ </div>
</section>
diff --git a/layouts/archive.html b/layouts/archive.html
new file mode 100644
index 00000000..3af7c9ce
--- /dev/null
+++ b/layouts/archive.html
@@ -0,0 +1,21 @@
+{{ define "main" }}
+<article>
+ {{ partial "header" . }}
+ {{ partial "home/home-nav" . }}
+ <div class="post-content text-size-lg">
+ <ol class="mx-0 my-4 p-0 leading-loose flex flex-col-reverse">
+ {{ range (.Site.RegularPages | collections.Reverse) }}
+ {{ if eq .Language .Site.Language }}
+ <li class="list-decimal text-secondary">
+ <div class="flex justify-between">
+ <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
+ <a href="/{{ .Section }}" class="font-mono text-secondary">{{ .Section }}</a>
+ </div>
+ </li>
+ {{ end }}
+ {{ end }}
+ </ol>
+ </div>
+</article>
+{{ partial "footer.html" . }}
+{{ end }}