diff --git a/config.toml b/config.toml index 44c8a76..acdef94 100644 --- a/config.toml +++ b/config.toml @@ -3,8 +3,11 @@ languageCode = "en-us" title = "My New Hugo Site" theme = "hugo-w2ng" pygmentsStyle="github" +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/)中还有很多文章✨**" AuthorName = "王不对" [[menu.main]] @@ -26,7 +29,7 @@ pygmentsStyle="github" [[menu.main]] name = "关于" url = "/about/" - weight = 3 + weight = 1 [markup] [markup.goldmark] diff --git a/themes/hugo-w2ng/assets/css/styles.css b/themes/hugo-w2ng/assets/css/styles.css index be87a1d..e881a0b 100644 --- a/themes/hugo-w2ng/assets/css/styles.css +++ b/themes/hugo-w2ng/assets/css/styles.css @@ -25,6 +25,9 @@ .markdown h4 { @apply leading-loose; } +.markdown p { + @apply my-4; +} .markdown blockquote { @apply bg-gray-100 p-3 mx-3 my-2 border-l-4 border-gray-400; } diff --git a/themes/hugo-w2ng/layouts/_default/baseof.html b/themes/hugo-w2ng/layouts/_default/baseof.html index af4db3f..b50f168 100644 --- a/themes/hugo-w2ng/layouts/_default/baseof.html +++ b/themes/hugo-w2ng/layouts/_default/baseof.html @@ -9,7 +9,7 @@ {{- block "main" . }}{{- end }} - {{- partial "footer.html" . -}} + {{- partialCached "footer.html" . -}} \ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/_default/list.html b/themes/hugo-w2ng/layouts/_default/list.html index 3b7cb0a..ed51bc7 100644 --- a/themes/hugo-w2ng/layouts/_default/list.html +++ b/themes/hugo-w2ng/layouts/_default/list.html @@ -1,12 +1,24 @@ {{ define "main" }} -
- {{- $pctx := . -}} - {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} - {{- $pages := $pctx.RegularPages -}} +
+ {{- partial "meta.html" . -}} - {{ range (where $pages "Section" "!=" "") }} +
+ {{ .Content }} +
+ + {{- $pctx := . -}} + + {{- $pages := $pctx.RegularPages -}} + {{- if .IsHome -}} + {{ $pages = .Site.RegularPages }} + {{ "**精选:**" | markdownify }} + {{- end -}} + {{ range $pages }}
- {{- partial "meta.html" . -}} + {{ if (eq $pctx.Kind "taxonomy") }} + {{ .Scratch.Set "taxonomy" (add $pctx.Type $pctx.Title) }} + {{ end }} + {{- partial "taxonomy.html" . -}}

{{ .Title }}

@@ -21,5 +33,14 @@
{{ 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 }} + {{ 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 7ac27ea..141c3f4 100644 --- a/themes/hugo-w2ng/layouts/_default/single.html +++ b/themes/hugo-w2ng/layouts/_default/single.html @@ -1,27 +1,6 @@ {{ define "main" }}
- {{ if .IsPage }} -
- {{- partial "meta.html" . -}} -

{{ .Title }}

- {{ if not .Params.disableMeta }} -

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

- {{ end }} -
- {{ end }} - {{ if not .IsHome }} -
- {{ end }} + {{- partial "meta.html" . -}}
{{ .Content }}
diff --git a/themes/hugo-w2ng/layouts/_default/summary.html b/themes/hugo-w2ng/layouts/_default/summary.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-w2ng/layouts/index.html b/themes/hugo-w2ng/layouts/index.html deleted file mode 100644 index 0b11a5d..0000000 --- a/themes/hugo-w2ng/layouts/index.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ define "main" }} -
-

{{ .Title }}

- {{ .Content }} -
-{{ end }} \ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/partials/header.html b/themes/hugo-w2ng/layouts/partials/header.html index 61bb5db..4d5c1f4 100644 --- a/themes/hugo-w2ng/layouts/partials/header.html +++ b/themes/hugo-w2ng/layouts/partials/header.html @@ -1,6 +1,7 @@ -
+
-

Wrong.Wang

+

Wrong.Wang

前进

@@ -12,11 +13,12 @@ -
+
\ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/partials/meta.html b/themes/hugo-w2ng/layouts/partials/meta.html index b7cb3e1..016e2a4 100644 --- a/themes/hugo-w2ng/layouts/partials/meta.html +++ b/themes/hugo-w2ng/layouts/partials/meta.html @@ -1,24 +1,22 @@ -
- {{ with .Params.categories }} - - {{ end }} - {{ with .Params.tags }} - + {{ end }} -
\ No newline at end of file + +{{ end }} +{{ if in (add "page" "section") .Kind }} +
+{{ end }} \ No newline at end of file diff --git a/themes/hugo-w2ng/layouts/partials/taxonomy.html b/themes/hugo-w2ng/layouts/partials/taxonomy.html new file mode 100644 index 0000000..3a6f4bd --- /dev/null +++ b/themes/hugo-w2ng/layouts/partials/taxonomy.html @@ -0,0 +1,34 @@ +{{ $currentPage := . }} +
+ {{ with .Params.categories }} + + {{ end }} + {{ with .Params.tags }} + + {{ end }} +
+{{ $currentPage.Scratch.Delete "taxonomy" }} \ No newline at end of file