aboutsummaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html37
-rw-r--r--layouts/_default/#baseof.html#29
l---------layouts/_default/.#baseof.html1
-rw-r--r--layouts/_default/baseof.html56
-rw-r--r--layouts/_default/single.html41
-rw-r--r--layouts/_default/term.html31
-rw-r--r--layouts/archives/single.html92
-rw-r--r--layouts/partials/footer.html4
-rw-r--r--layouts/partials/nav.html7
-rw-r--r--layouts/partials/seo_tags.html34
-rw-r--r--layouts/shortcodes/archives-list.html35
11 files changed, 109 insertions, 258 deletions
diff --git a/layouts/404.html b/layouts/404.html
index 1fac202..bdb53c6 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,33 +1,10 @@
-{{ define "title" }}
-404
-{{ end }}
-
+{{ define "title" }}404 Not Found{{ end }}
{{ define "main" }}
-<style>
-footer{display:none}
-.not-found {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- height: 100vh;
-}
-
-.not-found * {
- margin: 2rem;
- line-height: 0;
- }
-
- h1 {
- padding-bottom: 0.45em;
- font-size: 5rem;
- }
-
-</style>
-<div class="not-found">
+<main class=not-found>
<h1>🏝️</h1>
- <h3>OHHHHH~
- </h3>
- <h3>Who lives in a pineapple under the sea?</h3>
-</div>
+ <p><b>404 - NOT FOUND</b></p>
+ <p>OHHHHH~</p>
+ <p>Who lives in a pineapple under the sea?</p>
+ <p><a href={{ "" | relURL }}>Back to home</a></p>
+</main>
{{ end }}
diff --git a/layouts/_default/#baseof.html# b/layouts/_default/#baseof.html#
deleted file mode 100644
index a6224e8..0000000
--- a/layouts/_default/#baseof.html#
+++ /dev/null
@@ -1,29 +0,0 @@
-<!doctype html>
-<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
- <head>
- <!-- <link rel="stylesheet" href="/css/style.css" /> -->
- <link rel="stylesheet" href="/css/style.css" />
- <meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- {{- partial "favicon.html" . -}}
- <title>{{ .Title }}</title>
-
- {{- partial "seo_tags.html" . -}}
- <meta name="referrer" content="no-referrer-when-downgrade" />
- <link rel="alternate" type="application/rss+xml" href="/atom.xml" title="{{ .Site.Title }}">
-
- {{ with .OutputFormats.Get "rss" -}} {{ printf `
- <link rel="%s" type="%s" href="%s" title="%s" />
- ` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}}
-
- {{- partial "custom_head.html" . -}}
- </head>
-
- <body>
- <main>{{- block "main" . }}{{- end }}</main>
- <footer>{{- partial "footer.html" . -}}</footer>
-
- {{- partial "custom_body.html" . -}}
- </body>
-</html>
diff --git a/layouts/_default/.#baseof.html b/layouts/_default/.#baseof.html
deleted file mode 120000
index c37d2f8..0000000
--- a/layouts/_default/.#baseof.html
+++ /dev/null
@@ -1 +0,0 @@
-verdant@glowisle.178751:1780072799 \ No newline at end of file
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 54fa756..3516304 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,36 +1,26 @@
<!doctype html>
-<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
- <head>
- <!-- <link rel="stylesheet" href="/css/style.css" /> -->
- <link rel="stylesheet" href="/css/style.css" />
- <meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- {{- partial "favicon.html" . -}}
- <title>{{ .Title }}</title>
+<html lang={{ or .Site.LanguageCode "zh-cn" }}>
+<head>
+ <meta charset=utf-8>
+ <meta name=viewport content="width=device-width,initial-scale=1">
+ <meta http-equiv=X-Clacks-Overhead content="GNU Terry Pratchett">
+ <meta name=referrer content="no-referrer-when-downgrade">
+ <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ printf "%s | %s" .Title .Site.Title }}{{ end }}</title>
+ <style>body{font-family: monospace;line-height: 1.7;max-width: 720px;margin: 40px auto;padding: 0 20px;color:#2b2b2a;background: #f5f2eb;}pre{border: 1px dashed #555;padding: 12px;overflow-x: auto;}img {max-width: 100%;}</style>
+ {{- partial "favicon.html" . -}}
+ {{- partial "seo_tags.html" . -}}
+
+ <link rel=alternate type=application/rss+xml href=/atom.xml title={{ .Site.Title }}>
+ {{- with .OutputFormats.Get "rss" -}}
+ <link rel={{ .Rel }} type={{ .MediaType.Type }} href={{ .Permalink }} title={{ $.Site.Title }}>
+ {{- end -}}
+
+ {{- partial "custom_head.html" . -}}
+</head>
- {{- partial "seo_tags.html" . -}}
- <meta name="referrer" content="no-referrer-when-downgrade" />
- <link rel="alternate" type="application/rss+xml" href="/atom.xml" title="{{ .Site.Title }}">
-
-
- {{ with .OutputFormats.Get "rss" -}} {{ printf `
- <link rel="%s" type="%s" href="%s" title="%s" />
- ` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}}
-
- <!-- A partial to be overwritten by the user.
- Simply place a custom_head.html into
- your local /layouts/partials-directory -->
- {{- partial "custom_head.html" . -}}
- </head>
-
- <body>
- <main>{{- block "main" . }}{{- end }}</main>
- <footer>{{- partial "footer.html" . -}}</footer>
-
- <!-- A partial to be overwritten by the user.
- Simply place a custom_body.html into
- your local /layouts/partials-directory -->
- {{- partial "custom_body.html" . -}}
- </body>
+<body>
+ <main>{{ block "main" . }}{{ end }}</main>
+ <footer>{{ partial "footer.html" . }}</footer>
+ {{- partial "custom_body.html" . -}}
+</body>
</html>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 3006c56..407702a 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,40 +1,33 @@
{{ define "main" }}
-
-<header class="post-header">
- <span class="site-title"><a href="{{ "" | relURL }}">{{ .Site.Title }}</a></span>
- <nav>{{- partial "nav.html" . -}}</nav>
+<header>
+ <span class=site-title><a href={{ "" | relURL }}>{{ .Site.Title }}</a></span>
+ <nav>{{ partial "nav.html" . }}</nav>
</header>
-
<hr>
-<article class="h-entry">
- <header class="entry-meta">
- <h1 class="p-name post-title">{{ .Title }}</h1>
- <div class="meta-line">
- <time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
- {{ .Date.Format "2006-01-02" }}
- </time>
-
+<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="meta-categories">
- [{{ range $index, $cat := . }}{{ if $index }} · {{ end }}<a href="/categories/{{ $cat | urlize }}/" class="p-category">{{ $cat }}</a>{{ end }}]
- </span>
+ <span class=cats>[
+ {{- range $index, $cat := . -}}
+ {{- if $index }} · {{ end -}}<a href=/categories/{{ $cat | urlize }}/>{{ $cat }}</a>
+ {{- end -}}
+ ]</span>
{{ end }}
</div>
</header>
- <div class="e-content entry-body">
+ <div class=body>
{{ .Content }}
</div>
</article>
-
<hr>
-<footer class="post-footer">
- <div class="post-declaration">
- <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>
- </div>
+<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>
</footer>
-
{{ end }}
diff --git a/layouts/_default/term.html b/layouts/_default/term.html
index f074844..a76a935 100644
--- a/layouts/_default/term.html
+++ b/layouts/_default/term.html
@@ -1,22 +1,15 @@
{{ define "main" }}
-<div class="taxonomy-term">
- <h2>{{ .Title }}</h2>
+<main>
+ <h2>{{ .Title }}</h2>
- <div class="posts-list">
- {{ range .Pages }}
-
- <li style="list-style-type: none; margin-bottom: 12px">
- <span class="post-date" {{ if .Site.Params.groupByYear }}grouped{{ else }}ungrouped{{ end }}>
- <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
- {{ .Date.Format "2006-01-02" }}
- </time>
- </span>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </li>
-
- {{ else }}
- <p>该分类下还没有文章。</p>
- {{ end }}
- </div>
-</div>
+ <ul class=blog-posts>
+ {{ range .Pages }}
+ <li>
+ <time datetime={{ .Date.Format "2006-01-02" }}>{{ .Date.Format "2006-01-02" }}</time>
+ <a href={{ .Permalink }}>{{ .Title }}</a>
+ {{ else }}
+ <p>该分类下还没有文章。</p>
+ {{ end }}
+ </ul>
+</main>
{{ end }}
diff --git a/layouts/archives/single.html b/layouts/archives/single.html
index dc089ff..83436ac 100644
--- a/layouts/archives/single.html
+++ b/layouts/archives/single.html
@@ -1,66 +1,44 @@
{{ define "main" }}
<header>
-<a href="{{ "" | relURL }}" class="title">
- <p class="site-title">{{ .Site.Title }}</p>
-</a>
-<nav>{{- partial "nav.html" . -}}</nav>
+ <a href={{ "" | relURL }} class=title><p class=site-title>{{ .Site.Title }}</p></a>
+ <nav>{{ partial "nav.html" . }}</nav>
</header>
+<main>
+ {{ if .Data.Singular }}
+ <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3>
+ <small><a href={{ "blog" | relURL }}>Remove filter</a></small>
+ {{ end }}
-<content>
- {{ 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) }}
-
- {{ if .Site.Params.showPostCount }}
- <p id="post-count">There {{ if le (len $postPages) 1 }} is {{ len $postPages }} piece. {{ else }} are {{ len $postPages }} pieces. {{ end }}</p>
- {{ end }}
+ {{ $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 }}
- {{ if .Site.Params.groupByYear }}
- {{ $year := .Date.Year }}
- {{ if ne $year $currentYear }}
- <h3>{{ $year }}</h3>
- {{ $currentYear = $year }}
+ <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 }}
- {{ end }}
- <li>
- <span class="{{ if .Site.Params.groupByYear }} grouped {{ else }} ungrouped {{ end }}">
- <i>
- <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
- {{ if .Site.Params.groupByYear }}
- {{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
- {{ else }}
- {{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }}
- {{ end }}
- </time>
- </i>
- </span>
- <a style="border: none;" href="{{ .Permalink }}">{{ .Title }}</a>
- </li>
- {{ else }}
- <li>No posts yet</li>
- {{ end }}
- </ul>
+ </ul>
- {{ if .Data.Singular }}
- {{ else }}
- <small>
- <div>
- {{ range .Site.Taxonomies.tags }}
- <a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>&nbsp;
- {{ end }}
- </div>
- </small>
- {{ end }}
-</content>
+ {{ 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 }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index a40be26..e155231 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,3 +1 @@
-<div class="copyright">
- {{ .Site.Params.footer.content | markdownify }}
-</div>
+<footer>© 2024 - 2026 Verdant.</footer>
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index ad2f6d1..864a499 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -1,6 +1 @@
-{{ range .Site.Menus.main }}
-[<a href="{{ .URL }}">{{ .Name }}</a>]
-{{ end }}
-{{ with .Site.GetPage "/blog" }}
-<a href="{{ "blog/" | relURL }}">Blog</a>
-{{ end }}
+<nav>[<a href=/>首页</a>][<a href=/categories>分类</a>][<a href=/archives/>归档</a>][<a href=/links>链接</a>][<a href=/about/>关于</a>]</nav>
diff --git a/layouts/partials/seo_tags.html b/layouts/partials/seo_tags.html
index 4f594fd..96d390e 100644
--- a/layouts/partials/seo_tags.html
+++ b/layouts/partials/seo_tags.html
@@ -1,21 +1,13 @@
-<!-- Primary Meta Tags -->
-<meta name="title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}" />
-<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.Description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
-<meta name="keywords" content="{{ if .IsPage }}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
-
-<meta property="og:site_name" content="{{ .Site.Title }}">
- <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}">
- <meta property="og:url" content="{{ .Permalink }}">
- <meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
- <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
-
-<link rel="canonical" href="{{ .Permalink }}">
-
-<!-- Open Graph / Facebook -->
-{{ template "_internal/opengraph.html" . }}
-
-<!-- Twitter -->
-{{ template "_internal/twitter_cards.html" . }}
-
-<!-- Microdata -->
-{{ template "_internal/schema.html" . }}
+<link rel=canonical href={{ .Permalink }}>
+<meta name=title content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}">
+<meta name=description content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary | plainify | truncate 120 }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
+
+<meta property=og:site_name content="{{ .Site.Title }}">
+<meta property=og:title content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}">
+<meta property=og:url content="{{ .Permalink }}">
+<meta property=og:description content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary | plainify | truncate 120 }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
+<meta property=og:type content="{{ if .IsPage }}article{{ else }}website{{ end }}">
+
+<meta name=twitter:card content="summary">
+<meta name=twitter:title content="{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}">
+<meta name=twitter:description content="{{ if .Description }}{{ .Description }}{{ else if .IsPage }}{{ .Summary | plainify | truncate 120 }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
diff --git a/layouts/shortcodes/archives-list.html b/layouts/shortcodes/archives-list.html
deleted file mode 100644
index 738e368..0000000
--- a/layouts/shortcodes/archives-list.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<header>
-<a href="{{ "" | relURL }}" class="title">
- <p class="site-title">{{ .Site.Title }}</p>
-</a>
-<nav>{{- partial "nav.html" . -}}</nav>
-
-</header>
-
-{{ $allPages := where .Site.RegularPages "Type" "in" (slice "posts" "blog") }}
-{{ $visiblePages := where $allPages "Params.hidden" "!=" true }} {{ $pagesToShow
-:= $visiblePages.ByDate.Reverse }}
-
-<div class="archives-content">
- <h2>归档</h2>
-
- <p>共有 {{ len $pagesToShow }} 篇文章</p>
-
- <ul class="blog-posts">
- {{ $currentYear := 0 }} {{ range $pagesToShow }} {{ $year := .Date.Year }}
- {{ if ne $year $currentYear }}
- <h3>{{ $year }}</h3>
- {{ $currentYear = $year }} {{ end }}
- <li>
- <span>
- <i>
- <time datetime='{{ .Date.Format "2006-01-02" }}'>
- {{ .Date.Format "2006-01-02" }}
- </time>
- </i>
- </span>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </li>
- {{ end }}
- </ul>
-</div>