diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ce70d26..958d67b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -13,11 +13,14 @@ {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0abbe00..beee7b7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -14,9 +14,19 @@ {{ .Content }} - {{ partial "disqus.html" . }} - + {{- $.Scratch.Set "isDisqus" true -}} + {{- if and (isset .Params "disqus") (eq .Params.disabledisqus false) -}} + {{- $.Scratch.Set "isDisqus" false -}} + {{- end -}} + {{- if and (isset .Params "type") (in (.Site.Params.disableDisqusTypes | default (slice "page")) .Params.type) -}} + {{- $.Scratch.Set "isDisqus" false -}} + {{- end -}} + + {{- if eq ($.Scratch.Get "isDisqus") true -}} + {{- partial "disqus.html" . -}} + {{- end -}} + {{ partial "footer.html" . }} diff --git a/layouts/index.html b/layouts/index.html index bd08629..fefffe4 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -10,7 +10,11 @@ Recent posts
- {{- range first .Site.Params.SidebarRecentLimit .Data.Pages -}} + {{- $.Scratch.Set "counter" 0 -}} + {{- range .Data.Pages -}} + {{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}} + {{- else -}} + {{- if lt ($.Scratch.Get "counter") (.Site.Params.RecentPostsCount | default 10) -}}
{{ dateFormat "Jan 2, 2006" .Date }}
{{.Title}} — @@ -24,6 +28,9 @@ {{ end }}
+ {{- $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) -}} + {{- end -}} + {{- end -}} {{- end -}} All articles → @@ -32,5 +39,8 @@
{{ partial "footer.html" . }} {{ template "_internal/google_analytics_async.html" . }} + {{- with .Site.Params.Social -}} + + {{- end -}} diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html new file mode 100644 index 0000000..8a829eb --- /dev/null +++ b/layouts/partials/disqus.html @@ -0,0 +1,17 @@ +
+ + +comments powered by Disqus diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e59ec08..a1055ad 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,6 +1,17 @@
-

{{ .Site.Title }}

-

{{ .Site.Params.TitleTag | markdownify }}

+

{{ .Site.Title }}

+
+ {{- if isset .Site.Params "subtitle" -}} +

{{ .Site.Params.Subtitle | markdownify }}

+ {{- end -}} + +