From ba0e0ac249a419ee8c2ecd78f91da03ee0f680d7 Mon Sep 17 00:00:00 2001 From: nodejh Date: Sun, 28 Feb 2021 00:47:55 +0800 Subject: [PATCH] feat: remove useless codes --- layouts/404.html | 19 +------ layouts/_default/_markup/render-image.html | 1 - layouts/_default/baseof.html | 2 +- layouts/_default/list copy.html | 30 ---------- layouts/_default/page.html | 0 layouts/_default/single copy.html | 55 ------------------- layouts/_default/taxonomy.html | 3 + layouts/_default/terms copy.html | 27 --------- layouts/index copy-back.html | 16 ------ layouts/partials/disqus.html | 13 ----- layouts/partials/head.html | 52 ++++++++---------- layouts/partials/js.html | 25 --------- layouts/partials/latest-posts.html | 11 ---- layouts/partials/navigation.html | 5 +- layouts/partials/pagination.html | 18 ------ layouts/partials/post-list.html | 20 ------- layouts/partials/share.html | 9 --- layouts/partials/site-head.html | 31 ----------- layouts/partials/twitter-cards.html | 46 ---------------- .../section.html => section/about.html} | 0 layouts/section/about11.html | 19 ------- 21 files changed, 30 insertions(+), 372 deletions(-) delete mode 100644 layouts/_default/list copy.html create mode 100644 layouts/_default/page.html delete mode 100644 layouts/_default/single copy.html delete mode 100644 layouts/_default/terms copy.html delete mode 100644 layouts/index copy-back.html delete mode 100644 layouts/partials/disqus.html delete mode 100644 layouts/partials/js.html delete mode 100644 layouts/partials/latest-posts.html delete mode 100644 layouts/partials/pagination.html delete mode 100644 layouts/partials/post-list.html delete mode 100644 layouts/partials/share.html delete mode 100644 layouts/partials/site-head.html delete mode 100644 layouts/partials/twitter-cards.html rename layouts/{_default/section.html => section/about.html} (100%) delete mode 100644 layouts/section/about11.html diff --git a/layouts/404.html b/layouts/404.html index 04807cd..57db2e9 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,18 +1 @@ - {{ partial "head.html" . }} - - {{ partial "navigation.html" . }} - -
-
-
-

{{ with .Site.Params.title404 }}{{ . }}{{ else }}404 - Page not found{{ end }}

-

{{ with .Site.Params.subtitle404 }}{{ . }}{{ else }}The content you're looking for doesn't seem to exist.{{ end }}

-
- - {{ partial "latest-posts.html" . }} -
- - {{ partial "footer.html" . }} -
- - +404 \ No newline at end of file diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index d7c9ca1..ed9fb61 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,4 +1,3 @@ -

{{ .Text }}

\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 87b2377..12d7223 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,7 +3,7 @@ {{ block "title" . }}{{ with .Params.Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }} - {{ partialCached "site-head.html" . }} + {{ partialCached "head.html" . }} diff --git a/layouts/_default/list copy.html b/layouts/_default/list copy.html deleted file mode 100644 index 0aec539..0000000 --- a/layouts/_default/list copy.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ partial "head.html" . }} - - {{ partial "navigation.html" . }} - {{ partial "profile.html" . }} - -
- {{ range .Data.Pages.GroupByDate "2006" }} -
-

{{ .Key }}

- -
- {{ end }} - {{ partial "footer.html" . }} -
- -
-
- - {{ partial "js.html" . }} - - diff --git a/layouts/_default/page.html b/layouts/_default/page.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/single copy.html b/layouts/_default/single copy.html deleted file mode 100644 index a502e05..0000000 --- a/layouts/_default/single copy.html +++ /dev/null @@ -1,55 +0,0 @@ -{{ partial "head.html" . }} - - {{ partial "navigation.html" . }} - -
-
-
-

- {{ .Title }} -

-

- {{ .Date.Format "Jan 2, 2006 15:04" }} - · {{ if lt 1 .WordCount }}{{ .WordCount }} words{{ else }}{{ .WordCount }} word{{ end }} - · {{ .ReadingTime }} minute read - - {{ with .Params.tags }} - {{ if ge (len .) 1 }} - {{ range . }} - {{ . }} - {{ end }} - {{ end }} - {{ end}} - -

-
- {{ if .Site.Params.enableToc }} - {{ if .TableOfContents }} -
- {{ .TableOfContents }} -
- {{ end }} - {{ end }} -
- {{ .Content }} -
-
- - {{ if .Site.Params.enableShare }} - {{ partial "share.html" . }} - {{ end }} - - {{ if .Site.Params.enableDisqus }} - {{ partial "disqus.html" . }} - {{ end }} - - {{ if .Site.Params.showLatestPosts }} - {{ partial "latest-posts.html" . }} - {{ end }} - - {{ partial "footer.html" . }} -
- - {{ partial "js.html" . }} - - diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 4fcce78..fb4640a 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -2,6 +2,7 @@ {{ partial "profile.html" . }}
+ {{ range .Data.Pages.GroupByDate "2006" }}

@@ -29,9 +30,11 @@

{{ end }} + {{ end }} +
diff --git a/layouts/_default/terms copy.html b/layouts/_default/terms copy.html deleted file mode 100644 index b58282e..0000000 --- a/layouts/_default/terms copy.html +++ /dev/null @@ -1,27 +0,0 @@ -{{ partial "head.html" . }} - - {{ partial "navigation.html" . }} - {{ partial "profile.html" . }} - -
-
- -
- {{ partial "footer.html" . }} -
- - {{ partial "js.html" . }} - - diff --git a/layouts/index copy-back.html b/layouts/index copy-back.html deleted file mode 100644 index 8c63f69..0000000 --- a/layouts/index copy-back.html +++ /dev/null @@ -1,16 +0,0 @@ - {{ partial "head.html" . }} - - {{ partial "nav.html" . }} - - {{ partial "profile.html" . }} - -
- {{ partial "post-list.html" . }} - {{ partial "pagination.html" . }} - {{ partial "footer.html" . }} -
- - {{ partial "js.html" . }} - - -cl \ No newline at end of file diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html deleted file mode 100644 index ed90dd5..0000000 --- a/layouts/partials/disqus.html +++ /dev/null @@ -1,13 +0,0 @@ -
- - - diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 74e5e49..39bd9b9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,31 +1,27 @@ - - - - - - - {{ if .Site.Params.enableTwitterCard }} - {{ partial "twitter-cards.html" . }} - {{ end }} - {{ with .Site.Params.author }}{{ end }} - {{ with .Site.Params.description }}{{ end }} - {{ .Hugo.Generator }} - {{ if .IsHome }}{{ .Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }} - - - + + + + +{{ hugo.Generator }} +{{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}} +{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} + +{{ else }} + +{{ end }} - {{ if eq .Site.Params.iconFont "font-awesome" }} - - {{ else }} - - {{ end }} + + - {{ if .Site.Params.enableRSS }} - - {{ end }} - {{ range .Site.Params.customCSS }} - - {{ end }} - +{{ if .OutputFormats.Get "RSS" }} + {{ with .OutputFormats.Get "RSS" }} + + + {{ end }} +{{ end }} + +{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} +{{- template "_internal/opengraph.html" . -}} +{{- template "_internal/schema.html" . -}} +{{- template "_internal/twitter_cards.html" . -}} diff --git a/layouts/partials/js.html b/layouts/partials/js.html deleted file mode 100644 index 689a0ca..0000000 --- a/layouts/partials/js.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -{{ range .Site.Params.customJS }} - -{{ end }} - -{{ if .Site.Params.enableGoogleAnalytics }} - {{ template "_internal/google_analytics.html" . }} -{{ end }} - -{{ if .Site.Params.enableBaiduAnalytics }} - -{{ end }} diff --git a/layouts/partials/latest-posts.html b/layouts/partials/latest-posts.html deleted file mode 100644 index 344518f..0000000 --- a/layouts/partials/latest-posts.html +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/layouts/partials/navigation.html b/layouts/partials/navigation.html index 9519e0b..bd5c26a 100644 --- a/layouts/partials/navigation.html +++ b/layouts/partials/navigation.html @@ -4,16 +4,13 @@ {{ with .Site.Params.home }}{{ . }}{{ else }}Home{{ end }} {{ end }} {{ with .Site.Params.archive }}{{ . }}{{ else }}Archive{{ end }} + {{ with .Site.Params.tags }}{{ . }}{{ else }}Tags{{ end }} {{ with .Site.Params.about }}{{ . }}{{ else }}About{{ end }} {{ range $element := .Site.Params.Links }} {{ $element.name }} {{ end }} - {{ range $val := .Site.Params.Li }} - {{ $val }} - {{ end }} - {{ if .Site.Params.enableRSS }} {{ with .Site.Params.subscribe }}{{ . }}{{ else }}Subscribe{{ end }} {{ end }} diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html deleted file mode 100644 index 00c1124..0000000 --- a/layouts/partials/pagination.html +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/post-list.html b/layouts/partials/post-list.html deleted file mode 100644 index cbe6d04..0000000 --- a/layouts/partials/post-list.html +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/layouts/partials/share.html b/layouts/partials/share.html deleted file mode 100644 index ae73b21..0000000 --- a/layouts/partials/share.html +++ /dev/null @@ -1,9 +0,0 @@ - {{ .Site.Params.tweet | default "tweet" }} - - {{ .Site.Params.share | default "Share" }} - diff --git a/layouts/partials/site-head.html b/layouts/partials/site-head.html deleted file mode 100644 index a25141f..0000000 --- a/layouts/partials/site-head.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - -{{ hugo.Generator }} -{{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}} -{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} - -{{ else }} - -{{ end }} - - - - - -{{ if .OutputFormats.Get "RSS" }} - {{ with .OutputFormats.Get "RSS" }} - - - {{ end }} -{{ end }} - -{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} -{{- template "_internal/opengraph.html" . -}} -{{- template "_internal/schema.html" . -}} -{{- template "_internal/twitter_cards.html" . -}} - -{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} - {{ template "_internal/google_analytics_async.html" . }} -{{ end }} diff --git a/layouts/partials/twitter-cards.html b/layouts/partials/twitter-cards.html deleted file mode 100644 index 1e9c078..0000000 --- a/layouts/partials/twitter-cards.html +++ /dev/null @@ -1,46 +0,0 @@ -{{ if .IsPage }} - {{ with .Params.images }} - - - - {{ else }} - - {{ if .Site.Params.twitterCardImage }} - - {{ else }} - - {{ end }} - {{ end }} - - - - {{ with .Site.Params.twitter }} - - {{ end }} - {{ range .Site.Authors }} - {{ with .twitter }} - - {{ end }} - {{ end }} - - {{ if eq (len .Site.Authors) 0 }} - - {{ end }} - -{{ else }} - - - {{ with .Site.Params.twitter }} - - {{ end }} - {{ with .Site.Params.author }} - - {{ end }} - - - {{ if .Site.Params.twitterCardImage }} - - {{ else }} - - {{ end }} -{{ end }} diff --git a/layouts/_default/section.html b/layouts/section/about.html similarity index 100% rename from layouts/_default/section.html rename to layouts/section/about.html diff --git a/layouts/section/about11.html b/layouts/section/about11.html deleted file mode 100644 index 5ab1bd1..0000000 --- a/layouts/section/about11.html +++ /dev/null @@ -1,19 +0,0 @@ -{{ partial "head.html" . }} - -{{ partial "navigation.html" . }} -{{ partial "profile.html" . }} - -
- {{ .Content }} - - {{ if .Site.Params.enableDisqus }} - {{ if ne .Params.disabledisqus "true" }} - {{ partial "disqus.html" . }} - {{ end }} - {{ end }} - - {{ partial "footer.html" . }} -
- -{{ partial "js.html" . }} -