From 627b358901dbeb78ff9114eb1470f245190dce6a Mon Sep 17 00:00:00 2001 From: ehlxr Date: Thu, 11 Oct 2018 14:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20gitalk=20=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=92=8C=20disqus=20=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=EF=BC=9B=E6=B7=BB=E5=8A=A0=E6=96=87=E7=AB=A0=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/_custom.scss | 2 +- layouts/_default/single.html | 26 +++++++++++--------------- layouts/partials/comments.html | 4 ++-- layouts/partials/footer.html | 6 +++--- layouts/partials/head.html | 2 +- layouts/partials/toc.html | 32 +++++++++++++++++++++++++++++++- 6 files changed, 49 insertions(+), 23 deletions(-) diff --git a/assets/css/_custom.scss b/assets/css/_custom.scss index 591a1e5..9482d55 100644 --- a/assets/css/_custom.scss +++ b/assets/css/_custom.scss @@ -3,7 +3,7 @@ // ============================== // You can override the variables in _variables.scss to customize the style -.comments-container { +.post-comment { position: relative; width: 100%; max-width: 780px; diff --git a/layouts/_default/single.html b/layouts/_default/single.html index fbfa1d5..9fcb54f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,7 +4,7 @@

{{ .Title }}

@@ -44,7 +44,7 @@ {{ end }} - + {{ $reAltIn := "\"([^\"]+)?\"" }} {{ $reAltOut := ( printf "
\"$2\"
$2
" $cdn_url ) }} {{ $altContent := .Content | replaceRE $reAltIn $reAltOut | safeHTML }} @@ -57,31 +57,31 @@
- {{ with .Site.Params.author }} + {{ with .Site.Params.author }} {{ end }} - - {{ with .Permalink }} + + {{ with .Permalink }} {{ end }} - {{ with .Site.Params.license }} + {{ with .Site.Params.license }} {{ end }}
- + @@ -97,14 +97,10 @@
{{ if .PrevInSection }} - {{ end }} + {{ end }} {{ if .NextInSection }} {{ end }}
- -
- -
{{- end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index abfc5ab..26a9876 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,5 +1,5 @@ {{ if and .IsPage (ne .Params.comment false) }} -
+
{{- if and .Site.Params.disqus.name .Site.Params.disqus.lazy -}}
显示 Disqus 评论
{{- end -}} @@ -17,7 +17,7 @@ clientSecret: '{{ .Site.Params.gitalk.clientSecret }}', repo: '{{ .Site.Params.gitalk.repo }}', owner: '{{ .Site.Params.gitalk.owner }}', - admin: ['{{ .Site.Params.gitalk.owner }}'], + admin: ['{{ .Site.Params.gitalk.admin }}'], body: decodeURI(location.href) }); gitalk.render('gitalk-container'); diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index dc0bc1b..f2416e6 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,16 +5,16 @@ {{.}} - {{ now.Year }} {{ end }} - + {{ if .Site.Params.author }} - {{ .Site.Params.author }} | + {{ .Site.Params.author }} | {{ end }} {{ with .Site.Params.beian }} {{ . }} | {{ end }} - Powered by Hugo & LeaveIt + Powered by Hugo & LeaveIt
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2e08a5f..bdb2395 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -39,6 +39,6 @@ {{ if eq ( getenv "HUGO_ENV" ) "production" }} {{ with .Site.Params.cdn_url }} {{ $cdn_url = .}} - {{ end }} + {{ end }} {{ end }} {{ .Scratch.Set "cdn_url" $cdn_url }} diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 4703e72..263d754 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,4 +1,3 @@ -

{{ T "toc" }}

{{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }} @@ -6,3 +5,34 @@ {{.TableOfContents}}
+ + \ No newline at end of file