From 32059dbf0b34503de13ce46e69c44fc604a3953d Mon Sep 17 00:00:00 2001 From: svfcode Date: Fri, 30 Jun 2023 18:59:53 +0400 Subject: [PATCH 1/6] add disqus --- blog/config.yaml | 10 +++++++++- blog/layouts/index.html | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 blog/layouts/index.html diff --git a/blog/config.yaml b/blog/config.yaml index c8d1c13..91a5426 100644 --- a/blog/config.yaml +++ b/blog/config.yaml @@ -22,6 +22,12 @@ languages: weight: 1 params: + comments: + enabled: false + provider: disqus + # disqusjs: + # shortname: svfcode + widgets: homepage: - type: search @@ -35,4 +41,6 @@ params: params: limit: 10 page: - - type: toc \ No newline at end of file + - type: toc + +disqusShortname: svfcode \ No newline at end of file diff --git a/blog/layouts/index.html b/blog/layouts/index.html new file mode 100644 index 0000000..8312c29 --- /dev/null +++ b/blog/layouts/index.html @@ -0,0 +1,20 @@ +{{ define "main" }} + {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} + {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} + {{ $filtered := ($pages | intersect $notHidden) }} + {{ $pag := .Paginate ($filtered) }} + +
+ {{ range $index, $element := $pag.Pages }} + {{ partial "article-list/default" . }} + {{ end }} +
+ + {{- partial "comments/include.html" . -}} + {{- partial "pagination.html" . -}} + {{- partial "footer/footer" . -}} +{{ end }} + +{{ define "right-sidebar" }} + {{ partial "sidebar/right.html" (dict "Context" . "Scope" "homepage") }} +{{ end }} \ No newline at end of file From 48788e7d13b1af07af2139ede16de67b57c0a337 Mon Sep 17 00:00:00 2001 From: svfcode Date: Fri, 30 Jun 2023 19:03:54 +0400 Subject: [PATCH 2/6] fix --- blog/config.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/blog/config.yaml b/blog/config.yaml index 91a5426..5092a6f 100644 --- a/blog/config.yaml +++ b/blog/config.yaml @@ -25,8 +25,7 @@ params: comments: enabled: false provider: disqus - # disqusjs: - # shortname: svfcode + disqusShortname: svfcode widgets: homepage: @@ -42,5 +41,3 @@ params: limit: 10 page: - type: toc - -disqusShortname: svfcode \ No newline at end of file From b4cbce0f39e1d6454c72034054dad0f4c55272f7 Mon Sep 17 00:00:00 2001 From: svfcode Date: Fri, 30 Jun 2023 19:12:54 +0400 Subject: [PATCH 3/6] fix 2 --- blog/config.yaml | 2 ++ blog/layouts/index.html | 1 + 2 files changed, 3 insertions(+) diff --git a/blog/config.yaml b/blog/config.yaml index 5092a6f..d2ea74d 100644 --- a/blog/config.yaml +++ b/blog/config.yaml @@ -41,3 +41,5 @@ params: limit: 10 page: - type: toc + +disqusShortname: svfcode diff --git a/blog/layouts/index.html b/blog/layouts/index.html index 8312c29..e85045e 100644 --- a/blog/layouts/index.html +++ b/blog/layouts/index.html @@ -9,6 +9,7 @@ {{ partial "article-list/default" . }} {{ end }} + {{ template "_internal/disqus.html" . }} {{- partial "comments/include.html" . -}} {{- partial "pagination.html" . -}} From f7d9e67f84a16c4777f58844d01d4f96e39602f5 Mon Sep 17 00:00:00 2001 From: svfcode Date: Fri, 30 Jun 2023 19:23:33 +0400 Subject: [PATCH 4/6] fix 3 --- blog/layouts/index.html | 2 -- blog/layouts/partial/article/article.html | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 blog/layouts/partial/article/article.html diff --git a/blog/layouts/index.html b/blog/layouts/index.html index e85045e..0cd0b88 100644 --- a/blog/layouts/index.html +++ b/blog/layouts/index.html @@ -9,9 +9,7 @@ {{ partial "article-list/default" . }} {{ end }} - {{ template "_internal/disqus.html" . }} - {{- partial "comments/include.html" . -}} {{- partial "pagination.html" . -}} {{- partial "footer/footer" . -}} {{ end }} diff --git a/blog/layouts/partial/article/article.html b/blog/layouts/partial/article/article.html new file mode 100644 index 0000000..33b031f --- /dev/null +++ b/blog/layouts/partial/article/article.html @@ -0,0 +1,18 @@ +
+ {{ partial "article/components/header" . }} + + {{ partial "article/components/content" . }} + +stack by + {{ partial "comments/include.html" }} + + {{ partial "article/components/footer" . }} +standard + {{ template "_internal/disqus.html" . }} + + {{- partial "comments/include.html" . -}} + + {{ if or .Params.math .Site.Params.article.math }} + {{ partialCached "article/components/math.html" . }} + {{ end }} +
\ No newline at end of file From 758ce7195cf05c639373e8e80059ad38d7a80fda Mon Sep 17 00:00:00 2001 From: svfcode Date: Fri, 30 Jun 2023 19:30:31 +0400 Subject: [PATCH 5/6] fix 4 --- blog/layouts/{partial => partials}/article/article.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename blog/layouts/{partial => partials}/article/article.html (100%) diff --git a/blog/layouts/partial/article/article.html b/blog/layouts/partials/article/article.html similarity index 100% rename from blog/layouts/partial/article/article.html rename to blog/layouts/partials/article/article.html From 073bed18877f22f511ef75bddbfb50d7788e343e Mon Sep 17 00:00:00 2001 From: svfcode Date: Fri, 30 Jun 2023 19:41:05 +0400 Subject: [PATCH 6/6] fix 5 --- blog/config.yaml | 2 +- blog/layouts/partials/article/article.html | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/blog/config.yaml b/blog/config.yaml index d2ea74d..62771a8 100644 --- a/blog/config.yaml +++ b/blog/config.yaml @@ -23,7 +23,7 @@ languages: params: comments: - enabled: false + enabled: true provider: disqus disqusShortname: svfcode diff --git a/blog/layouts/partials/article/article.html b/blog/layouts/partials/article/article.html index 33b031f..f3f7e90 100644 --- a/blog/layouts/partials/article/article.html +++ b/blog/layouts/partials/article/article.html @@ -3,14 +3,7 @@ {{ partial "article/components/content" . }} -stack by - {{ partial "comments/include.html" }} - {{ partial "article/components/footer" . }} -standard - {{ template "_internal/disqus.html" . }} - - {{- partial "comments/include.html" . -}} {{ if or .Params.math .Site.Params.article.math }} {{ partialCached "article/components/math.html" . }}