From 1e709b5ba48256988de2140ffb2a84ca956b5887 Mon Sep 17 00:00:00 2001
From: Dillon ZENG
Date: Fri, 2 Aug 2019 16:16:59 +0800
Subject: [PATCH] fix: fix disqus feature and format
---
layouts/404.html | 26 ++++----
layouts/_default/single.html | 22 +++----
layouts/index.html | 10 +--
layouts/partials/comments.html | 111 ++++++++++++++-------------------
layouts/rss.xml | 46 +++++++-------
layouts/sitemap.xml | 51 +++++++--------
6 files changed, 121 insertions(+), 145 deletions(-)
diff --git a/layouts/404.html b/layouts/404.html
index 56f9f929..da1ae411 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,16 +1,16 @@
{{ define "content" }}
-
+
{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 71f52c6d..d9bd592c 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -37,7 +37,7 @@
{{ end }}
-
+
{{ $reAltIn := "" }}
{{ $reAltOut := ( printf "" $cdn_url ) }}
{{ $altContent := .Content | replaceRE $reAltIn $reAltOut | safeHTML }}
@@ -56,12 +56,12 @@
{{ . }}
{{ end }}
-
+
{{ i18n "Words" }}:
{{ .WordCount }}
-
+
{{ if and ( $.Param "socialShare" ) (gt (len ($.Param "share")) 0) }}
{{ i18n "Share" }}:
@@ -76,19 +76,19 @@
{{ end }}
-
{{ with .Params.tags }}
{{ end }}
@@ -96,16 +96,16 @@
{{ if .PrevInSection }}
{{ .PrevInSection.Title}}
- {{ end }}
+ {{ end }}
{{ if .NextInSection }}
{{.NextInSection.Title}}
{{ end }}
{{- end }}
diff --git a/layouts/index.html b/layouts/index.html
index b2ffa600..167ce66b 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,7 +1,7 @@
{{ define "content" }}
- {{ if eq .Site.Params.home_mode "post" }}
- {{ partial "home_post.html" . }}
- {{ else }}
- {{ partial "home_profile.html" . }}
- {{ end }}
+ {{ if eq .Site.Params.home_mode "post" }}
+ {{ partial "home_post.html" . }}
+ {{ else }}
+ {{ partial "home_profile.html" . }}
+ {{ end }}
{{ end }}
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index d5549383..33e9f8b4 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -1,68 +1,51 @@
{{ if and .IsPage (ne .Params.comment false) -}}
-
- {{- if .Site.DisqusShortname -}}
-
-
-
- {{- end -}}
+
+ {{- if .Site.Params.gitalk.owner -}}
+
+
+
+
+
+ {{- end }}
-
- {{- if .Site.Params.gitalk.owner -}}
-
-
-
-
-
- {{- end }}
-
- {{- if .Site.Params.valine.enable -}}
-
- pm
- 1000000
-
-
-
-
-
-
- {{- end -}}
+
+ {{- if .Site.Params.valine.enable -}}
+
+ pm
+ 1000000
+
+
+
+
+
+
+ {{- end -}}
{{- end }}
-
diff --git a/layouts/rss.xml b/layouts/rss.xml
index ebfb43be..0c06c992 100644
--- a/layouts/rss.xml
+++ b/layouts/rss.xml
@@ -1,24 +1,26 @@
-
- {{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}
- {{ .Permalink }}
- Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }}
- Hugo -- gohugo.io{{ with .Site.LanguageCode }}
- {{.}}{{end}}{{ with .Site.Author.email }}
- {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }}
- {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }}
- {{.}}{{end}}{{ if not .Date.IsZero }}
- {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}
-
- {{ range first 15 (where .Data.Pages "Type" "!=" "home") }}
- -
- {{ .Title }}
- {{ .Permalink }}
- {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}
- {{ with .Site.Author.email }}{{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}
- {{ .Permalink }}
- {{ .Content | html }}
-
- {{ end }}
-
+
+ {{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}
+ {{ .Permalink }}
+ Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }}
+ Hugo -- gohugo.io{{ with .Site.LanguageCode }}
+ {{.}}{{end}}{{ with .Site.Author.email }}
+ {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }}
+ {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }}
+ {{.}}{{end}}{{ if not .Date.IsZero }}
+ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}
+
+ {{ range first 15 (where .Data.Pages "Type" "!=" "home") }}
+ -
+ {{ .Title }}
+ {{ .Permalink }}
+ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}
+ {{ with .Site.Author.email }}
+ {{.}}{{ with site.Author.name }} ({{.}}){{end}}
+ {{end}}
+ {{ .Permalink }}
+ {{ .Content | html }}
+
+ {{ end }}
+
diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml
index 797088f9..20c6f28b 100644
--- a/layouts/sitemap.xml
+++ b/layouts/sitemap.xml
@@ -1,31 +1,22 @@
-
- {{ range (where .Data.Pages "Section" "!=" "gallery") }}
-
- {{ .Permalink }}
- {{ if not .Lastmod.IsZero }}
- {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}
- {{ end }}
- {{ with .Sitemap.ChangeFreq }}
- {{ . }}
- {{ end }}
- {{ if ge .Sitemap.Priority 0.0 }}
- {{ .Sitemap.Priority }}
- {{ end }}
- {{ if .IsTranslated }}
- {{ range .Translations }}
-
- {{ end }}
-
- {{ end }}
-
- {{ end }}
+
+ {{ range (where .Data.Pages "Section" "!=" "gallery") }}
+
+ {{ .Permalink }}
+ {{ if not .Lastmod.IsZero }}
+ {{ safeHTML ( .Lastmod.Format"2006-01-02T15:04:05-07:00" ) }}
+ {{ end }}
+ {{ with .Sitemap.ChangeFreq }}
+ {{ . }}
+ {{ end }}
+ {{ if ge .Sitemap.Priority 0.0 }}
+ {{ .Sitemap.Priority }}
+ {{ end }}
+ {{ if .IsTranslated }}
+ {{ range .Translations }}
+
+ {{ end }}
+
+ {{ end }}
+
+ {{ end }}