From 231964080b26b3b3cab91b2c6144a784d3bef99d Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Sun, 14 Jun 2020 00:06:35 +0800 Subject: In-post APlayer now support multiple files --- layouts/_default/single.html | 2 +- layouts/partials/head.html | 2 +- layouts/partials/scripts-end.html | 21 +++++++++++++-------- 3 files changed, 15 insertions(+), 10 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index db5e2f5..413cacc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,7 +7,7 @@
{{ partial "post-meta.html" . }}
- {{ with .Params.playerURL }} + {{ with .Params.player }}
{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0603c4d..6470262 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -41,7 +41,7 @@ {{ end }} -{{ if .Params.playerURL }} +{{ if .Params.player }} {{ end }} {{ if .Site.Params.useDisqusJS }} diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index 862e0e2..2e1de5f 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -7,20 +7,25 @@ -{{ with .Params.playerURL }} +{{ with .Params.player }} - {{ with .Params.player }} diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html index fef9bd3..e57b8fb 100644 --- a/layouts/shortcodes/img-lazy.html +++ b/layouts/shortcodes/img-lazy.html @@ -1,10 +1,22 @@ -{{ 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 +{{- 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 deleted file mode 100644 index bfdb26a..0000000 --- a/layouts/shortcodes/img-nz-lazy.html +++ /dev/null @@ -1,25 +0,0 @@ -{{ 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 deleted file mode 100644 index 1b4f791..0000000 --- a/layouts/shortcodes/img-nz.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ if (index .Params 2) }} - - {{ index .Params 0 }} - -{{ else }} -{{ index .Params 0 }} -{{ end }} \ No newline at end of file -- cgit v1.2.3 From 72ccecdc5b8bd5fef140c706902eb2139068d748 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Sun, 14 Jun 2020 23:30:00 +0800 Subject: Generate json for searching --- layouts/_default/index.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 layouts/_default/index.json (limited to 'layouts') diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 0000000..a823e62 --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "search" slice -}} +{{- range (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) -}} + {{- $.Scratch.Add "search" (dict "title" .Title "tags" .Params.tags "contents" .Plain "permalink" .Permalink) -}} +{{- end -}} +{{- $.Scratch.Get "search" | jsonify -}} \ No newline at end of file -- cgit v1.2.3 From 398ca6e2f300cce5c7bf7fa69fde42b4b592f5a4 Mon Sep 17 00:00:00 2001 From: Jiawei Huang Date: Sun, 14 Jun 2020 14:05:14 -0700 Subject: Add preliminary Google AdSense support When `googleAdsense` is set in `config.toml`, the AdSense code snippet will be inserted between the `` tags of your site. Only Google AdSense Auto ads is supported at the moment. --- layouts/partials/head.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'layouts') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0603c4d..b953cd8 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -41,6 +41,15 @@ {{ end }} +{{ if .Site.Params.googleAdsense }} + + +{{ end}} {{ if .Params.playerURL }} {{ end }} -- cgit v1.2.3 From d0569100c68fc2dd9c7fae4d91915fd49da8d71f Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Mon, 15 Jun 2020 14:13:02 +0800 Subject: Search page template --- layouts/_default/search.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 layouts/_default/search.html (limited to 'layouts') diff --git a/layouts/_default/search.html b/layouts/_default/search.html new file mode 100644 index 0000000..b92861a --- /dev/null +++ b/layouts/_default/search.html @@ -0,0 +1,20 @@ +{{ define "main" }} + +
+
+
+ +
+
+ +
+
+
+ +
+

+ Not Finished Yet +

+
+ +{{ end }} \ No newline at end of file -- cgit v1.2.3 From a3376d1ad133455b73ca893e222c1aec89ae6d44 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Mon, 15 Jun 2020 23:50:54 +0800 Subject: Update searching based on Fuse.js --- layouts/_default/index.json | 2 +- layouts/_default/search.html | 18 +++++++----------- layouts/partials/scripts-end.html | 27 +++++++++++++++++++++++---- 3 files changed, 31 insertions(+), 16 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/index.json b/layouts/_default/index.json index a823e62..bf08b0f 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -1,5 +1,5 @@ {{- $.Scratch.Add "search" slice -}} {{- range (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) -}} - {{- $.Scratch.Add "search" (dict "title" .Title "tags" .Params.tags "contents" .Plain "permalink" .Permalink) -}} + {{- $.Scratch.Add "search" (dict "title" .Title "tags" .Params.tags "permalink" .Permalink) -}} {{- end -}} {{- $.Scratch.Get "search" | jsonify -}} \ No newline at end of file diff --git a/layouts/_default/search.html b/layouts/_default/search.html index b92861a..f9c808c 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -1,20 +1,16 @@ {{ define "main" }} - +
-
+
- +
- +
- -
-

- Not Finished Yet -

-
- + +
{{ end }} \ No newline at end of file diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index e5426ad..1cd0c62 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -1,13 +1,34 @@ + +{{ if eq .Section "search" }} + + + + +{{ else if eq .Section "archives" }} +{{ else }} - +{{ end }} + {{ with .Params.player }} + {{ end }} \ No newline at end of file diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index 5176053..3e366e7 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -1 +1 @@ - {{ .Date.Format "2006-01-02" }}{{ 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 + {{ .Date.Format "2006-01-02" }}{{ 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 index 69c5dca..2959beb 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -2,27 +2,8 @@ {{ if eq .Section "search" }} - - - - + + {{ else if eq .Section "archives" }} {{ else }} @@ -37,6 +18,7 @@ - + {{ end }} \ No newline at end of file diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index 2959beb..83ce1d6 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -1,6 +1,5 @@ - {{ if eq .Section "search" }} @@ -10,9 +9,7 @@ {{ end }} - - {{ with .Params.player }} -- cgit v1.2.3 From 03750a600a71df1276ccfcc7c817de5cb86e3e9f Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Tue, 16 Jun 2020 15:42:19 +0800 Subject: Fix meta text align in archives and search page --- layouts/partials/head.html | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 88f398f..88d3d19 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -9,7 +9,6 @@ {{ partial "favicon.html" . }} - {{ if and (.IsHome) (.Site.Params.subTitle) }} {{ .Site.Title }} - {{ .Site.Params.subTitle }} @@ -22,16 +21,13 @@ {{ end }} {{ if or (.Params.description) (.Site.Params.description) }} - + {{ end }} {{ if .Params.tags }} {{ end }} - {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} - {{ if .Site.Params.useHugoPipes }} {{ $options := (dict "targetPath" "assets/css/fuji-custom.min.css" "outputStyle" "compressed") }} @@ -40,17 +36,14 @@ {{ else }} {{ end }} - {{ with .Site.Params.googleAdsense }} {{ end}} - {{ if .Params.player }} {{ end }} {{ if .Site.Params.useDisqusJS }} {{ end }} - {{ partial "analytic-gtag.html" . }} {{ partial "analytic-cfga.html" . }} \ No newline at end of file -- cgit v1.2.3 From f88c7b78f224bf746b831001ec8cef01693a4b3c Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Tue, 16 Jun 2020 16:09:04 +0800 Subject: Search page i18n --- layouts/_default/search.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/search.html b/layouts/_default/search.html index c37d6b9..8948e45 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -5,14 +5,14 @@
- +
- - - + + +
{{ if eq .Section "search" }} - - + {{ else if eq .Section "archives" }} {{ else }} -- cgit v1.2.3 From 5c68750e0cd265464aa55b1f1d89e54f7e71ccc0 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 18 Jun 2020 14:17:51 +0800 Subject: Optimize toc & license settings logic --- layouts/_default/single.html | 2 +- layouts/partials/sidebar.html | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 413cacc..26a8213 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -16,7 +16,7 @@ -{{ if and (.Site.Params.showLicense) (ne .Params.noLicense true) }} +{{ if and (or .Site.Params.showLicense .Params.showLicense) (ne .Params.showLicense false) }}

{{ i18n "postCopyrightFront" }} - {{ if and (in .Site.Params.mainSections .Type) (and (.Site.Params.showToc) (ne .Params.noToc true)) }} + {{ if in .Site.Params.mainSections .Type }} + {{ if and (or .Site.Params.showToc .Params.showToc) (ne .Params.showToc false) }}

{{ end }} + {{ end }}
{{ end }} -{{ if .Site.Params.disqusJSApi }} +{{ if and (.Site.Params.disqusJSApi) (ne .Params.showComments false) }} {{ partial "comment-disqusjs.html" . }} -{{ else if .Site.Params.disqusShortname }} +{{ else if and (.Site.Params.disqusShortname) (ne .Params.showComments false) }} {{ partial "comment-disqus.html" . }} -{{ else if .Site.Params.utterancesRepo }} +{{ else if and (.Site.Params.utterancesRepo) (ne .Params.showComments false) }} {{ partial "comment-utterances.html" . }} {{ else }}{{ end }} {{ end }} \ No newline at end of file -- cgit v1.2.3