diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 669dc06a1581212c915807dc26e845df10c1bb60..b104a7c73f0b58ca956a10534a9c066b9bfe5200 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -208,7 +208,7 @@ enableEmoji = true # Disqus Comment Config (https://disqus.com/) [languages.en.params.comment.disqus] # Disqus shortname to use Disqus in posts - shortname = "dillonzq" + shortname = "" # Gittalk Comment Config (https://github.com/gitalk/gitalk) [languages.en.params.comment.gitalk] owner = "" @@ -423,7 +423,7 @@ enableEmoji = true # Disqus 评论系统设置 (https://disqus.com/) [languages.zh-CN.params.comment.disqus] # Disqus 的用户名,用来在文章中启用 Disqus 评论系统 - shortname = "dillonzq" + shortname = "" # Gittalk 评论系统设置 (https://github.com/gitalk/gitalk) [languages.zh-CN.params.comment.gitalk] owner = "" @@ -638,7 +638,7 @@ enableEmoji = true # Disqus Comment Config (https://disqus.com/) [languages.fr.params.comment.disqus] # Disqus shortname to use Disqus in posts - shortname = "dillonzq" + shortname = "" # Gittalk Comment Config (https://github.com/gitalk/gitalk) [languages.fr.params.comment.gitalk] owner = "" @@ -674,6 +674,9 @@ enableEmoji = true # public git repo url only then enableGitInfo is true # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 gitRepo = "https://github.com/dillonzq/LoveIt" + # which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5") + # 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5") + fingerprint = "" # Header info # 页面头部导航栏信息 [params.header] diff --git a/exampleSite/content/posts/theme-documentation-basics.en.md b/exampleSite/content/posts/theme-documentation-basics.en.md index 53f8fcd5454287ea9ce6f3053902dbc496d2ea93..14b2b16074f601ad4c12a360f90cdb266442fd5a 100644 --- a/exampleSite/content/posts/theme-documentation-basics.en.md +++ b/exampleSite/content/posts/theme-documentation-basics.en.md @@ -193,6 +193,9 @@ Note that some of these parameters are explained in details in other sections of defaultTheme = "auto" # public git repo url only then enableGitInfo is true gitRepo = "" + # LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1 + # which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5") + fingerprint = "" # Header info [params.header] # desktop header mode ("fixed", "normal", "auto") diff --git a/exampleSite/content/posts/theme-documentation-basics.fr.md b/exampleSite/content/posts/theme-documentation-basics.fr.md index 30b47697a65b1b4cc17c2d1f5a281a81814a181b..90e39756b58cb3e28ca0975a30fd30744ed8b3c3 100644 --- a/exampleSite/content/posts/theme-documentation-basics.fr.md +++ b/exampleSite/content/posts/theme-documentation-basics.fr.md @@ -198,6 +198,9 @@ Note that some of these parameters are explained in details in other sections of defaultTheme = "auto" # public git repo url only then enableGitInfo is true gitRepo = "" + # LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1 + # which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5") + fingerprint = "" # Header info [params.header] # desktop header mode ("fixed", "normal", "auto") diff --git a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md index 46bf18125cf8704a8b0375301d35bf161eff5bf7..07cd0e72dc88048056e6b33f86dc80c9d566e901 100644 --- a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md @@ -193,6 +193,9 @@ hugo defaultTheme = "auto" # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 gitRepo = "" + # LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1 + # 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5") + fingerprint = "" # 页面头部导航栏信息 [params.header] # 桌面端导航栏模式 ("fixed", "normal", "auto") diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 90f5b6fbe80943138f8da92f45d30142bfbc2094..80eac99dc48d65c9dd0533968adf259e06361ece 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,6 +8,7 @@ {{- if eq hugo.Environment "production" -}} {{- $scratch.Set "production" true -}} {{- $scratch.Set "CDN" .Site.Params.cdn -}} + {{- $scratch.Set "fingerprint" .Site.Params.fingerprint -}} {{- end -}} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index ee74fc7e6b15a0b8bde5e9949274682ba5464ea6..cd95510773f35d44078f6493ffec576eb0da7fdb 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -11,7 +11,7 @@ {{- /* Title */ -}}

- {{ .Title }} + {{ .Title }}

{{- /* Meta */ -}} @@ -55,7 +55,7 @@ {{- /* Footer */ -}}
- {{ T "readMore" }} + {{ T "readMore" }} {{- with .Params.tags -}}
{{- range . -}} diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index aa901c5806d05bf3c8f7907a0ea94dc244201bc4..9ff4cd42fb53296347298defc615d50a26594487 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -35,7 +35,7 @@ {{- end -}} {{- /* lightgallery.js */ -}} -{{- if ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}} +{{- if ne .Site.Params.page.lightgallery false | and (ne .Params.lightgallery false) -}} {{- with $CDN.lightgalleryCSS -}} {{- slice . | $scratch.Add "linkCDN" -}} {{- else -}} @@ -222,8 +222,8 @@ {{- else if not (strings.HasSuffix . ".min.css") -}} {{- $res = minify $res -}} {{- end -}} - {{- $res = $res | resources.Fingerprint "sha256" -}} - + {{- $stylesheet := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}} + {{- partial "plugin/stylesheet.html" $stylesheet -}} {{- end -}} {{- range $scratch.Get "scriptCDN" -}} @@ -234,8 +234,8 @@ {{- if not (strings.HasSuffix . ".min.js") -}} {{- $res = minify $res -}} {{- end -}} - {{- $res = $res | resources.Fingerprint "sha256" -}} - + {{- $script := (dict "resource" $res "fingerprint" ($scratch.Get "fingerprint")) -}} + {{- partial "plugin/script.html" $script -}} {{- end -}} {{- /* Google analytics async */ -}} diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 14b2cf45c3ecc4a95d889f118a44596c56bfdd82..b24ab1a7bf59b5a7b0322a878f71c879eb254635 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -6,7 +6,7 @@ {{- /* Disqus Comment System */ -}} {{- with .Site.Params.comment.disqus.shortname -}}
- {{- $script := printf `` . -}} + {{- $script := printf `` . -}} {{- slice $script | $scratch.Add "scriptCDN" -}}
diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html index 8faaf2b16cdf0b17c356bf9d1f0c185edad4b04b..d1a7f95912305b9ae4d6b042d3c29cd2fd762599 100644 --- a/layouts/taxonomy/terms.html +++ b/layouts/taxonomy/terms.html @@ -23,20 +23,20 @@

- +  {{ $term | humanize}}

{{- range first 5 $pages -}} {{- end -}} {{- if gt (len $pages) 5 -}} - {{ T "more" }} >> + {{ T "more" }} >> {{- end -}}
@@ -49,7 +49,7 @@ {{- else if eq $taxonomies "tags" -}}
{{- range $.Site.Taxonomies.tags.ByCount -}} - {{ .Page.Title }} ({{ .Count }}) + {{ .Page.Title }} ({{ .Count }}) {{- end -}}
{{- end -}} diff --git a/package.json b/package.json index 8ba283148fda9c4dcbc9f010e0515ef829efd1c5..40f7c8bd84b3705d9e0995a097cd9cf73e544cbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loveit-src", - "version": "0.1.0", + "version": "0.1.1", "description": "LoveIt theme source file", "main": "index.js", "dependencies": {}, diff --git a/resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.json b/resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.json deleted file mode 100644 index 358f1f73c366371557823c1b742c3fcbd73bfa04..0000000000000000000000000000000000000000 --- a/resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.json +++ /dev/null @@ -1 +0,0 @@ -{"Target":"css/style.min.8596c27951d415c1b2ad9aee1d642e8057049327eca5ce9e397bdd27d84ca62a.css","MediaType":"text/css","Data":{"Integrity":"sha256-hZbCeVHUFcGyrZruHWQugFcEkyfspc6eOXvdJ9hMpio="}} \ No newline at end of file diff --git a/resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.content b/resources/_gen/assets/scss/css/style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.content similarity index 100% rename from resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.content rename to resources/_gen/assets/scss/css/style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.content diff --git a/resources/_gen/assets/scss/css/style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.json b/resources/_gen/assets/scss/css/style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.json new file mode 100644 index 0000000000000000000000000000000000000000..0095485dc99d5df992a26d4dfcb0cc31cc8a4642 --- /dev/null +++ b/resources/_gen/assets/scss/css/style.template.scss_b8ba9a60a151126bfcde1421dc0b972d.json @@ -0,0 +1 @@ +{"Target":"css/style.min.css","MediaType":"text/css","Data":{}} \ No newline at end of file diff --git a/resources/_gen/assets/scss/lib/aplayer/dark.scss_6a9b89851c76ccc96568016ff9eba049.content b/resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content similarity index 100% rename from resources/_gen/assets/scss/lib/aplayer/dark.scss_6a9b89851c76ccc96568016ff9eba049.content rename to resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content diff --git a/resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json b/resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json new file mode 100644 index 0000000000000000000000000000000000000000..0f0de78639d21724d8d7c0376a0d2179fada4b0d --- /dev/null +++ b/resources/_gen/assets/scss/lib/aplayer/dark.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json @@ -0,0 +1 @@ +{"Target":"lib/aplayer/dark.css","MediaType":"text/css","Data":{}} \ No newline at end of file diff --git a/resources/_gen/assets/scss/lib/aplayer/dark.scss_6a9b89851c76ccc96568016ff9eba049.json b/resources/_gen/assets/scss/lib/aplayer/dark.scss_6a9b89851c76ccc96568016ff9eba049.json deleted file mode 100644 index abbb8099c87a90b7161874b8bccd20c444cb3587..0000000000000000000000000000000000000000 --- a/resources/_gen/assets/scss/lib/aplayer/dark.scss_6a9b89851c76ccc96568016ff9eba049.json +++ /dev/null @@ -1 +0,0 @@ -{"Target":"lib/aplayer/dark.cf3d10211c52ef53113d7dc3ab708c366141ee4459043a50b02215bc8a2ef76a.css","MediaType":"text/css","Data":{"Integrity":"sha256-zz0QIRxS71MRPX3Dq3CMNmFB7kRZBDpQsCIVvIou92o="}} \ No newline at end of file diff --git a/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_6a9b89851c76ccc96568016ff9eba049.content b/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content similarity index 100% rename from resources/_gen/assets/scss/lib/mermaid/mermaid.scss_6a9b89851c76ccc96568016ff9eba049.content rename to resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.content diff --git a/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json b/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json new file mode 100644 index 0000000000000000000000000000000000000000..bfc9c3ca4a1769cfddf91a688eade5ae57e42512 --- /dev/null +++ b/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_4fddb88d50abca04f2e7ef77f0bb1c3b.json @@ -0,0 +1 @@ +{"Target":"lib/mermaid/mermaid.css","MediaType":"text/css","Data":{}} \ No newline at end of file diff --git a/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_6a9b89851c76ccc96568016ff9eba049.json b/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_6a9b89851c76ccc96568016ff9eba049.json deleted file mode 100644 index 0a98c2e89243a2cfec52a78a7a4f4bff6383dd0f..0000000000000000000000000000000000000000 --- a/resources/_gen/assets/scss/lib/mermaid/mermaid.scss_6a9b89851c76ccc96568016ff9eba049.json +++ /dev/null @@ -1 +0,0 @@ -{"Target":"lib/mermaid/mermaid.828bd139deac55c048b4d9ed77d849196aada4a0ea2268d7c59946e8d71665b7.css","MediaType":"text/css","Data":{"Integrity":"sha256-govROd6sVcBItNntd9hJGWqtpKDqImjXxZlG6NcWZbc="}} \ No newline at end of file