diff options
| author | verdant <im@verdant.ee> | 2026-05-31 16:36:13 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-05-31 16:36:13 +0800 |
| commit | d91f48c4945acd1b9f76a79d7804580b70b0c2df (patch) | |
| tree | 6844217a5b61d31d6d2a837fb708db411825bc5c /layouts/_default | |
| parent | 7876c3763897092266e535cd464d45637862d73b (diff) | |
| download | blog-d91f48c4945acd1b9f76a79d7804580b70b0c2df.tar.gz blog-d91f48c4945acd1b9f76a79d7804580b70b0c2df.zip | |
Refactor: remove bloated CSS style and nested HTML layouts
Diffstat (limited to 'layouts/_default')
| -rw-r--r-- | layouts/_default/#baseof.html# | 29 | ||||
| l--------- | layouts/_default/.#baseof.html | 1 | ||||
| -rw-r--r-- | layouts/_default/baseof.html | 56 | ||||
| -rw-r--r-- | layouts/_default/single.html | 41 | ||||
| -rw-r--r-- | layouts/_default/term.html | 31 |
5 files changed, 52 insertions, 106 deletions
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 }} |
