From dfb6e1f80754c1c8f2d4d332c5292319f008a67b Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 27 May 2020 22:53:13 +0800 Subject: v2 original port --- layouts/404.html | 2 +- layouts/_default/_markup/render-image.html | 2 +- layouts/_default/archives.html | 32 +++---- layouts/_default/baseof.html | 30 +++--- layouts/_default/list.html | 30 +++--- layouts/_default/single.html | 10 +- layouts/_default/tag.html | 30 +++--- layouts/partials/comment-disqus.html | 18 ---- layouts/partials/comment-utterances.html | 4 +- layouts/partials/components.html | 8 ++ layouts/partials/footer.html | 9 +- layouts/partials/head.html | 77 +++++++-------- layouts/partials/header.html | 6 +- layouts/partials/math.html | 4 + layouts/partials/post-meta.html | 6 +- layouts/partials/scripts-end.html | 146 +++++++++++++++++++++++++++++ layouts/partials/scripts-front.html | 18 ++++ layouts/partials/scripts.html | 97 ------------------- layouts/partials/sidebar.html | 102 ++++++++++---------- layouts/robots.txt | 2 +- layouts/shortcodes/img-lazy.html | 10 ++ layouts/shortcodes/img-nz-lazy.html | 25 +++++ layouts/shortcodes/img-nz.html | 7 ++ layouts/shortcodes/lazyimg-col.html | 3 - layouts/shortcodes/lazyimg-row.html | 3 - layouts/shortcodes/lazyimg.html | 3 - 26 files changed, 395 insertions(+), 289 deletions(-) delete mode 100644 layouts/partials/comment-disqus.html create mode 100644 layouts/partials/components.html create mode 100644 layouts/partials/math.html create mode 100644 layouts/partials/scripts-end.html create mode 100644 layouts/partials/scripts-front.html delete mode 100644 layouts/partials/scripts.html create mode 100644 layouts/shortcodes/img-lazy.html create mode 100644 layouts/shortcodes/img-nz-lazy.html create mode 100644 layouts/shortcodes/img-nz.html delete mode 100644 layouts/shortcodes/lazyimg-col.html delete mode 100644 layouts/shortcodes/lazyimg-row.html delete mode 100644 layouts/shortcodes/lazyimg.html (limited to 'layouts') diff --git a/layouts/404.html b/layouts/404.html index eec3ded..ee8fb79 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,5 +1,5 @@ {{ define "main" }} -
+
404 NOT FOUND
{{ end }} \ No newline at end of file diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index f9493b1..b9020c7 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1 +1 @@ -{{ .Text }} \ No newline at end of file +{{ .Text }} \ No newline at end of file diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index cb4b911..b3a7c13 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -6,11 +6,11 @@ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) 50 }} {{ range $paginator.Pages }} -
-

+
+

{{ .Title }} -

-

+
@@ -22,16 +22,16 @@ {{ $lowerLimit := (add $offsetLinks 1) }} {{ $upperLimit := (sub $paginator.TotalPages $offsetLinks) }} {{ if gt $paginator.TotalPages 1 }} -
{{ end }} {{ range $paginator.Pagers }} {{ $.Scratch.Set "pageNumFlag" false }} @@ -53,22 +53,22 @@ {{ $.Scratch.Set "pageNumFlag" true }} {{ end }} {{ if eq ($.Scratch.Get "pageNumFlag") true }} -
  • +
    {{ .PageNumber }} -
  • + {{ end }} {{ end }} {{ if $paginator.HasNext }} -
  • +
    -
  • + {{ end }} {{ if ne $paginator.PageNumber $paginator.TotalPages }} -
  • +
    -
  • + {{ end }} - + {{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8d4a8db..a61499c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,34 +1,30 @@ -{{ partial "head.html" . }} - + + {{ partial "head.html" . }} + + + + {{ partial "scripts-front.html" . }} {{ partial "header.html" . }}
    -
    +
    {{ block "main" . }}{{ end }}
    - - - - {{ if .Site.Params.playerURL }} -
    - {{ end }} - {{ if .Site.Params.scrollTop }} -
    - -
    - {{ end }} + {{ partial "sidebar.html" . }}
    + {{ partial "components.html" . }}
    {{ partial "footer.html" . }} - {{ partial "scripts.html" . }} + {{ if or .Params.math .Site.Params.math }} + {{ partial "math.html" . }} + {{ end }} + {{ partial "scripts-end.html" . }} \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index bcefcc2..0e52ab4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,13 +3,13 @@ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} {{ range $paginator.Pages }}
    -

    +

    {{ .Title }}

    -
    + -
    +
    {{ .Summary }}
    @@ -21,16 +21,16 @@ {{ $lowerLimit := (add $offsetLinks 1) }} {{ $upperLimit := (sub $paginator.TotalPages $offsetLinks) }} {{ if gt $paginator.TotalPages 1 }} -
    {{ end }} {{ range $paginator.Pagers }} {{ $.Scratch.Set "pageNumFlag" false }} @@ -52,22 +52,22 @@ {{ $.Scratch.Set "pageNumFlag" true }} {{ end }} {{ if eq ($.Scratch.Get "pageNumFlag") true }} -
  • +
  • +
    {{ end }} {{ end }} {{ if $paginator.HasNext }} -
  • +
    -
  • + {{ end }} {{ if ne $paginator.PageNumber $paginator.TotalPages }} -
  • +
    -
  • + {{ end }} - + {{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e2b0fc1..72ec0a8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,10 +1,10 @@ {{ define "main" }}
    -

    +

    {{ .Title }} -

    -
    + + {{ with .Params.playerURL }} @@ -19,12 +19,12 @@ {{ if ne .Params.noLicense true }}
    -

    {{ i18n "postCopyrightFront" }}{{ .Site.Params.license }}{{ i18n "postCopyrightEnd" }}

    +

    {{ i18n "postCopyrightFront" }}{{ .Site.Params.license }}{{ i18n "postCopyrightEnd" }}

    {{ end }} {{ if ne .Params.noComments true }} {{ partial "comment-utterances.html" . }} -{{ partial "comment-disqus.html" . }} {{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/_default/tag.html b/layouts/_default/tag.html index 97d6ead..7bcabb8 100644 --- a/layouts/_default/tag.html +++ b/layouts/_default/tag.html @@ -7,13 +7,13 @@ {{ $paginator := .Paginator }} {{ range $paginator.Pages }}
    -

    +

    {{ .Title }}

    - {{ end }} {{ range $paginator.Pagers }} {{ $.Scratch.Set "pageNumFlag" false }} @@ -56,22 +56,22 @@ {{ $.Scratch.Set "pageNumFlag" true }} {{ end }} {{ if eq ($.Scratch.Get "pageNumFlag") true }} -
  • +
  • +
    {{ end }} {{ end }} {{ if $paginator.HasNext }} -
  • +
    -
  • +
    {{ end }} {{ if ne $paginator.PageNumber $paginator.TotalPages }} -
  • +
    -
  • + {{ end }} - + {{ end }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html deleted file mode 100644 index 539f8c7..0000000 --- a/layouts/partials/comment-disqus.html +++ /dev/null @@ -1,18 +0,0 @@ -{{ with .Site.Params.disqusShortname }} -
    -
    - -
    -{{ end }} \ No newline at end of file diff --git a/layouts/partials/comment-utterances.html b/layouts/partials/comment-utterances.html index 3e56201..43c06bf 100644 --- a/layouts/partials/comment-utterances.html +++ b/layouts/partials/comment-utterances.html @@ -4,6 +4,8 @@

    {{ i18n "postCommentLoading" }}

    - +
    {{ end }} \ No newline at end of file diff --git a/layouts/partials/components.html b/layouts/partials/components.html new file mode 100644 index 0000000..273f813 --- /dev/null +++ b/layouts/partials/components.html @@ -0,0 +1,8 @@ +
    +
    + +
    +
    + +
    +
    \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index be8f5bf..cb43e10 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,10 @@ \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 134f6e4..c306ade 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -18,51 +18,54 @@ {{ else }} {{ .Title }} - {{ .Site.Title }} {{ end }} - - +{{ if or (.Params.author) (.Site.Params.author) }} + +{{ end }} +{{ if or (.Params.description) (.Site.Params.description) }} + +{{ end }} {{ if .Params.tags }} {{ end }} + {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} -{{ template "_internal/google_analytics_async.html" . }} - -{{ $options := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") }} -{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} - + +{{ $sass := resources.Get "fuji.scss" }} +{{ $options := (dict "targetPath" "assets/css/fuji.min.css" "outputStyle" "compressed" "enableSourceMap" true) }} +{{ $style := $sass | resources.ToCSS $options }} + - -{{ if .Site.Params.useCDN }} - - - - -{{ if or (.Site.Params.playerURL) (.Params.playerURL) }} - - -{{ end }} - +{{ if .Site.Params.useResourceCDN }} + + + + + + + {{ else }} -{{ $jquery := resources.Get "js/jquery.min.js" }} - -{{ $lazysizes := resources.Get "js/lazysizes.min.js" }} - -{{ $fontawesome := resources.Get "css/fontawsome.min.css" }} - -{{ $zoom := resources.Get "js/medium-zoom.min.js" }} - -{{ if or (.Site.Params.playerURL) (.Params.playerURL) }} -{{ $aplayerCSS := resources.Get "css/APlayer.min.css" }} - -{{ $aplayerJS := resources.Get "js/APlayer.min.js" }} - -{{ end }} + + + + + + + {{ end }} - -{{ if or (.Params.math) (.Site.Params.math) }} - - - +{{ with .Site.GoogleAnalytics }} + + + {{ end }} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 3166a36..a08e2d9 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,9 +1,9 @@
    - diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..aca973a --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index 80f3a16..1d0a081 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -1 +1,5 @@ -{{ if .Site.Params.showWordCounter }} {{ .WordCount }}{{ i18n "postMetaWordCount" }}{{ end }}{{ if .Site.Params.showReadTime }} {{ .ReadingTime }}{{ i18n "postMetaReadingTime" }}{{ end }} {{ if .Params.tags }}{{ range .Params.tags }}{{ . }} {{ end }}{{ else }}{{ i18n "postMetaNoTag" }}{{ end }} \ No newline at end of file +{{ if .Site.Params.showWordCounter }} +{{ .WordCount }}{{ i18n "postMetaWordCount" }}{{ end }}{{ if .Site.Params.showReadTime }} +{{ .ReadingTime }}{{ i18n "postMetaReadingTime" }}{{ end }} +{{ if .Params.tags }}{{ range .Params.tags }}{{ . }} {{ end }}{{ else }}{{ i18n "postMetaNoTag" }}{{ end }} \ No newline at end of file diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html new file mode 100644 index 0000000..d82ab58 --- /dev/null +++ b/layouts/partials/scripts-end.html @@ -0,0 +1,146 @@ + + + + +{{ if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.utterancesRepo) }} + +{{ else }} + +{{ end }} + +{{ with .Params.playerURL }} + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/scripts-front.html b/layouts/partials/scripts-front.html new file mode 100644 index 0000000..9fa99b6 --- /dev/null +++ b/layouts/partials/scripts-front.html @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html deleted file mode 100644 index 6bcdd8b..0000000 --- a/layouts/partials/scripts.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - -{{ if ne .Params.noComments true }} -{{ if and (.IsPage) (.Site.Params.utterancesRepo) }} - -{{ end }} -{{ end }} - - -{{ if in .Site.Params.mainSections .Type }} - -{{ end }} -{{ if .Site.Params.scrollTop }} - - -{{ end }} - - -{{ with .Params.playerURL }} - -{{ end }} - -{{ with .Site.Params.playerURL }} - -{{ end }} \ No newline at end of file diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 51e53d3..8e902c1 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,51 +1,53 @@ - -{{ if in .Site.Params.mainSections .Type }} -
    -
    {{ i18n "sidebarToc" }}
    - {{.TableOfContents}} -
    -{{ end }} - -
    -
    {{ i18n "sidebarPages" }}
    -
      - {{ $currentPage := . }} - {{ range .Site.Menus.nav }} -
    • - {{ .Name }} -
    • - {{ end }} -
    • - RSS -
    • -
    -
    - -
    -
    {{ i18n "sidebarTags" }}
    -
    - {{ range .Site.Taxonomies.tags }} - - {{ .Page.Title }} - - {{ end }} +
    - - - -{{ with .Site.Params.bgmImageChart }} -
    -
    {{ i18n "sidebarBangumiChart" }}
    - Bangumi Image Chart -
    -{{ end }} \ No newline at end of file + {{ end }} + + + + + + + {{ with .Site.Params.bgmImageChart }} + + + {{ end }} + \ No newline at end of file diff --git a/layouts/robots.txt b/layouts/robots.txt index 4c807e2..02138ab 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,3 +1,3 @@ User-agent: * -Sitemap: {{ .Site.BaseURL }}/sitemap.xml +Sitemap: {{ "/sitemap.xml" | relURL }} diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html new file mode 100644 index 0000000..fef9bd3 --- /dev/null +++ b/layouts/shortcodes/img-lazy.html @@ -0,0 +1,10 @@ +{{ if len .Params | eq 2 }} +{{ index .Params 0 }} +{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }} +{{ index .Params 1 }} +{{ else if eq (index .Params 0) "col" }} +{{ index .Params 1 }} +{{ else }}{{ end }}{{ else }}{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html new file mode 100644 index 0000000..bfdb26a --- /dev/null +++ b/layouts/shortcodes/img-nz-lazy.html @@ -0,0 +1,25 @@ +{{ if len .Params | eq 2 }} +{{ index .Params 0 }} +{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }} +{{ index .Params 1 }} +{{ else if eq (index .Params 0) "col" }} +{{ index .Params 1 }} +{{ else }} + + {{ index .Params 0 }} + +{{ end }}{{ else if len .Params | eq 4 }}{{ if eq (index .Params 0) "row" }} + + {{ index .Params 1 }} + +{{ else if eq (index .Params 0) "col" }} + + {{ index .Params 1 }} + +{{ else }}{{ end }}{{ else }}{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/img-nz.html b/layouts/shortcodes/img-nz.html new file mode 100644 index 0000000..1b4f791 --- /dev/null +++ b/layouts/shortcodes/img-nz.html @@ -0,0 +1,7 @@ +{{ if (index .Params 2) }} + + {{ index .Params 0 }} + +{{ else }} +{{ index .Params 0 }} +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-col.html b/layouts/shortcodes/lazyimg-col.html deleted file mode 100644 index ce68446..0000000 --- a/layouts/shortcodes/lazyimg-col.html +++ /dev/null @@ -1,3 +0,0 @@ -

    - {{ index .Params 0 }} -

    \ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-row.html b/layouts/shortcodes/lazyimg-row.html deleted file mode 100644 index 61e61ec..0000000 --- a/layouts/shortcodes/lazyimg-row.html +++ /dev/null @@ -1,3 +0,0 @@ -

    - {{ index .Params 0 }} -

    \ No newline at end of file diff --git a/layouts/shortcodes/lazyimg.html b/layouts/shortcodes/lazyimg.html deleted file mode 100644 index ff36b35..0000000 --- a/layouts/shortcodes/lazyimg.html +++ /dev/null @@ -1,3 +0,0 @@ -

    - {{ index .Params 0 }} -

    \ No newline at end of file -- cgit v1.2.3