diff --git a/config.toml b/config.toml index acdef94..2cac9a0 100644 --- a/config.toml +++ b/config.toml @@ -7,7 +7,7 @@ hasCJKLanguage = true enableEmoji = true [params] Footer = "© 2019 王不对 - **[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)** - **[RSS](/index.xml)**" - HomeDesc = "**[博客](/blog/)和[飞行手册](/flight-rules/)中还有很多文章✨**" + HomeDesc = "**[博客](/blog/) 和 [飞行手册](/flight-rules/)中还有很多文章✨**" AuthorName = "王不对" [[menu.main]] diff --git a/themes/hugo-w2ng/assets/css/site.css b/themes/hugo-w2ng/assets/css/site.css index d207d03..a86c993 100644 --- a/themes/hugo-w2ng/assets/css/site.css +++ b/themes/hugo-w2ng/assets/css/site.css @@ -1,13 +1,3 @@ -body { - font-family: Optima, Candara, Calibri, Arial, sans-serif; -} -code { - font-family: "Lucida Console", Monaco, monospace; - font-size: 85%; -} - -/* menu */ - @media (max-width: 768px) { #menu-check ~ label .close-icon { display: none; diff --git a/themes/hugo-w2ng/assets/css/styles.css b/themes/hugo-w2ng/assets/css/styles.css index e881a0b..25e1f9d 100644 --- a/themes/hugo-w2ng/assets/css/styles.css +++ b/themes/hugo-w2ng/assets/css/styles.css @@ -50,10 +50,10 @@ @apply overflow-x-auto p-4 border border-solid border-gray-400 shadow-lg; } .markdown code { - @apply bg-gray-200; + @apply bg-gray-200 font-mono text-sm; } .markdown pre code { - @apply bg-transparent font-mono; + @apply bg-transparent; } .markdown ul { @apply text-base pl-8 list-disc; @@ -67,3 +67,7 @@ .markdown hr { @apply block my-6 mx-auto max-w-md h-px border-t border-black; } + +.markdown a { + @apply border-b border-black; +} diff --git a/themes/hugo-w2ng/assets/css/tailwind.config.js b/themes/hugo-w2ng/assets/css/tailwind.config.js index dd6532c..833e9bc 100644 --- a/themes/hugo-w2ng/assets/css/tailwind.config.js +++ b/themes/hugo-w2ng/assets/css/tailwind.config.js @@ -1,5 +1,10 @@ module.exports = { theme: { + fontFamily: { + 'sans': ['Optima', 'Candara', '"Lucida Sans"', 'Calibri', 'Arial', 'source-han-serif-sc', '"Source Han Serif SC"', + '"Source Han Serif CN"', '"Source Han Serif TC"', '"Source Han Serif TW"', '"Source Han Serif"', '"Songti SC"', '"Microsoft YaHei"', "sans-serif"], + 'mono': ['Menlo', 'Monaco', 'Consolas', '"Liberation Mono"', '"Courier New"', 'SFMono-Regular', 'monospace'], + }, extend: {} }, variants: {}, diff --git a/themes/hugo-w2ng/layouts/_default/baseof.html b/themes/hugo-w2ng/layouts/_default/baseof.html index b50f168..dfd9888 100644 --- a/themes/hugo-w2ng/layouts/_default/baseof.html +++ b/themes/hugo-w2ng/layouts/_default/baseof.html @@ -2,7 +2,7 @@ {{- partial "head.html" . -}} - +
{{- partial "header.html" . -}}
diff --git a/themes/hugo-w2ng/layouts/_default/list.html b/themes/hugo-w2ng/layouts/_default/list.html index ed51bc7..82de346 100644 --- a/themes/hugo-w2ng/layouts/_default/list.html +++ b/themes/hugo-w2ng/layouts/_default/list.html @@ -1,46 +1,15 @@ {{ define "main" }}
- {{- partial "meta.html" . -}} - -
+
{{ .Content }}
{{- $pctx := . -}} - - {{- $pages := $pctx.RegularPages -}} - {{- if .IsHome -}} - {{ $pages = .Site.RegularPages }} - {{ "**精选:**" | markdownify }} - {{- end -}} - {{ range $pages }} -
+ {{ range .RegularPages }} {{ if (eq $pctx.Kind "taxonomy") }} {{ .Scratch.Set "taxonomy" (add $pctx.Type $pctx.Title) }} {{ end }} - {{- partial "taxonomy.html" . -}} -

{{ .Title }}

- -
- {{ if .Description }} - {{ .Description | markdownify }} - {{ else }} - {{ if .Truncated }} - {{ .Summary | truncate 150 | markdownify }}... - {{ end }} - {{ end }} -
-
- {{ end }} - - {{- if .IsHome -}} - {{ range $tagName, $taxonomy := .Site.Taxonomies.categories }} - {{ with $.Site.GetPage (printf "%s/%s" "categories" $tagName) }} - {{ $tagName }}({{ len $taxonomy }}) - {{ end }} - {{ end }} - {{ .Page.Site.Params.HomeDesc | markdownify }} + {{ .Render "summary"}} {{ end }}
{{ end }} \ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/_default/single.html b/themes/hugo-w2ng/layouts/_default/single.html index 141c3f4..31903bc 100644 --- a/themes/hugo-w2ng/layouts/_default/single.html +++ b/themes/hugo-w2ng/layouts/_default/single.html @@ -1,6 +1,23 @@ {{ define "main" }}
- {{- partial "meta.html" . -}} +
+ {{- partial "taxonomy.html" . -}} +

{{ .Title }}

+ {{ if not .Params.disableMeta }} +

+ {{ with $.Site.Params.AuthorName }} +

+ {{ end }} +
+
{{ .Content }}
diff --git a/themes/hugo-w2ng/layouts/_default/summary.html b/themes/hugo-w2ng/layouts/_default/summary.html index e69de29..63901c8 100644 --- a/themes/hugo-w2ng/layouts/_default/summary.html +++ b/themes/hugo-w2ng/layouts/_default/summary.html @@ -0,0 +1,15 @@ +
+ {{- partial "taxonomy.html" . -}} +

{{ .Title }}

+ +
+ {{ if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ if .Truncated }} + {{ .Summary | truncate 150 | markdownify }}... + {{ end }} + {{ end }} +
+
\ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/index.html b/themes/hugo-w2ng/layouts/index.html new file mode 100644 index 0000000..cf5c5e2 --- /dev/null +++ b/themes/hugo-w2ng/layouts/index.html @@ -0,0 +1,40 @@ +{{ define "main" }} +
+ + + + +
+ {{ .Content }} + {{ $optBlock := dict "display" "block" }} + + {{ "**精选:**" | .RenderString $optBlock }} +
    + {{ range (where .Site.RegularPages "Section" "!=" "") }} + {{ if .Params.spotlight }} +
  • + {{ .Date.Format "2006/01/02" }} + {{ .Title }} +
  • + {{ end }} + {{ end }} +
+ + {{ "**分类:**" | .RenderString $optBlock }} + +
+ {{ range $tagName, $taxonomy := .Site.Taxonomies.categories }} + {{ with $.Site.GetPage (printf "%s/%s" "categories" $tagName) }} + + {{ $tagName }}({{ len $taxonomy }}) + + {{ end }} + {{ end }} +
+ {{ .Page.Site.Params.HomeDesc | .RenderString $optBlock }} +
+ + + +
+{{ end }} \ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/partials/meta.html b/themes/hugo-w2ng/layouts/partials/meta.html deleted file mode 100644 index 016e2a4..0000000 --- a/themes/hugo-w2ng/layouts/partials/meta.html +++ /dev/null @@ -1,22 +0,0 @@ -{{ if in (add "page" "section") .Kind }} -
- {{- partial "taxonomy.html" . -}} -

{{ .Title }}

- {{ if and (not .Params.disableMeta) .IsPage }} -

- {{ with $.Site.Params.AuthorName }} -

- {{ end }} -
-{{ end }} -{{ if in (add "page" "section") .Kind }} -
-{{ end }} \ No newline at end of file