- {{ range $terms }}
- {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "taxonomy") }}
- {{ end }}
+
- {{ end }}
+ {{ end }}
+
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 8a5ff95..081277b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,12 +1,20 @@
-
+
{{- partial "head/head.html" . -}}
{{- block "head" . -}}{{ end }}
{{- partial "head/colorScheme" . -}}
-
+
+ {{/* The container is wider when there's any activated widget */}}
+ {{- $hasWidget := false -}}
+ {{- range .Site.Params.widgets -}}
+ {{- if gt (len .) 0 -}}
+ {{- $hasWidget = true -}}
+ {{- end -}}
+ {{- end -}}
+
{{- block "left-sidebar" . -}}
{{ partial "sidebar/left.html" . }}
{{- end -}}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 90e5b66..9bc618d 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,46 +1,48 @@
{{ define "main" }}
-
- {{ if eq .Parent (.GetPage "/") }}
- {{ T "list.section" }}
- {{ else }}
- {{ .Parent.Title }}
- {{ end }}
-
-
-
-
-
{{ T "list.page" (len .Pages) }}
- {{ .Title }}
- {{ with .Params.description }}
- {{ . }}
+
+
+ {{ if eq .Parent (.GetPage "/") }}
+ {{ T "list.section" }}
+ {{ else }}
+ {{ .Parent.Title }}
{{ end }}
-
+
- {{- $image := partialCached "helper/image" (dict "Context" . "Type" "section") .RelPermalink "section" -}}
- {{ if $image.exists }}
-
- {{ if $image.resource }}
- {{- $Permalink := $image.resource.RelPermalink -}}
- {{- $Width := $image.resource.Width -}}
- {{- $Height := $image.resource.Height -}}
-
- {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
- {{- $thumbnail := $image.resource.Fill "120x120" -}}
- {{- $Permalink = $thumbnail.RelPermalink -}}
- {{- $Width = $thumbnail.Width -}}
- {{- $Height = $thumbnail.Height -}}
- {{- end -}}
-
-

- {{ else }}
-

+
+
+
{{ T "list.page" (len .Pages) }}
+ {{ .Title }}
+ {{ with .Params.description }}
+ {{ . }}
{{ end }}
- {{ end }}
-
+
+ {{- $image := partialCached "helper/image" (dict "Context" . "Type" "section") .RelPermalink "section" -}}
+ {{ if $image.exists }}
+
+ {{ if $image.resource }}
+ {{- $Permalink := $image.resource.RelPermalink -}}
+ {{- $Width := $image.resource.Width -}}
+ {{- $Height := $image.resource.Height -}}
+
+ {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
+ {{- $thumbnail := $image.resource.Fill "120x120" -}}
+ {{- $Permalink = $thumbnail.RelPermalink -}}
+ {{- $Width = $thumbnail.Width -}}
+ {{- $Height = $thumbnail.Height -}}
+ {{- end -}}
+
+

+ {{ else }}
+

+ {{ end }}
+
+ {{ end }}
+
+
{{- $subsections := .Sections -}}
{{- $pages := .Pages | complement $subsections -}}
@@ -53,14 +55,16 @@
{{- end -}}
{{- with $subsections -}}
-
{{ T "list.subsection" (len $subsections) }}
-
-
- {{ range . }}
- {{ partial "article-list/tile" (dict "context" . "size" "250x150" "Type" "section") }}
- {{ end }}
+
+
{{- end -}}
{{/* List only pages that are not a subsection */}}
@@ -77,5 +81,5 @@
{{ end }}
{{ define "right-sidebar" }}
- {{ partialCached "sidebar/right.html" . }}
+ {{ partial "sidebar/right.html" (dict "Context" . "Scope" "homepage") }}
{{ end }}
\ No newline at end of file
diff --git a/layouts/rss.xml b/layouts/_default/rss.xml
similarity index 86%
rename from layouts/rss.xml
rename to layouts/_default/rss.xml
index 178f997..e9f3f1a 100644
--- a/layouts/rss.xml
+++ b/layouts/_default/rss.xml
@@ -1,9 +1,15 @@
-{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
-{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}}
-{{- $filtered := ($pages | intersect $notHidden) -}}
+{{- $pctx := . -}}
+{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
+{{- $pages := slice -}}
+{{- if or $.IsHome $.IsSection -}}
+{{- $pages = $pctx.RegularPages -}}
+{{- else -}}
+{{- $pages = $pctx.Pages -}}
+{{- end -}}
+{{- $pages := where $pages "Params.hidden" "!=" true -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
-{{- $filtered = $filtered | first $limit -}}
+{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "" | safeHTML }}
@@ -20,7 +26,7 @@
{{- with .OutputFormats.Get "RSS" -}}
{{ printf "" .Permalink .MediaType | safeHTML }}
{{- end -}}
- {{ range $filtered }}
+ {{ range $pages }}
{{- $content := safeHTML (.Summary | html) -}}
{{- if .Site.Params.rssFullContent -}}
{{- $content = safeHTML (.Content | html) -}}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 8ce42e9..5f300bf 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,15 +1,26 @@
{{ define "body-class" }}
- {{ $TOCEnabled := default (default false .Site.Params.article.toc) .Params.toc }}
- {{- .Scratch.Set "hasTOC" (and (ge (len .TableOfContents) 100) $TOCEnabled) -}}
- article-page {{ if (.Scratch.Get "hasTOC") }}has-toc{{ end }}
-{{ end }}
+ article-page
+ {{/*
+ Enable the right sidebar if
+ - Widget different from 'TOC' is enabled
+ - TOC is enabled and not empty
+ */}}
+ {{- $HasWidgetNotTOC := false -}}
+ {{- $TOCWidgetEnabled := false -}}
+ {{- range .Site.Params.widgets.page -}}
+ {{- if ne .type "toc" -}}
+ {{ $HasWidgetNotTOC = true -}}
+ {{- else -}}
+ {{ $TOCWidgetEnabled = true -}}
+ {{- end -}}
+ {{- end -}}
-{{ define "container-class" }}
- {{ if (.Scratch.Get "hasTOC") }}
- extended
- {{ else }}
- on-phone--column {{ if .Site.Params.widgets.enabled }}extended{{ else }}compact{{ end }}
- {{ end }}
+ {{- $TOCManuallyDisabled := eq .Params.toc false -}}
+ {{- $TOCEnabled := and (not $TOCManuallyDisabled) $TOCWidgetEnabled -}}
+ {{- $hasTOC := ge (len .TableOfContents) 100 -}}
+ {{- .Scratch.Set "TOCEnabled" (and $TOCEnabled $hasTOC) -}}
+
+ {{- .Scratch.Set "hasWidget" (or $HasWidgetNotTOC (and $TOCEnabled $hasTOC)) -}}
{{ end }}
{{ define "main" }}
@@ -19,7 +30,7 @@
{{ partial "article/components/links" . }}
{{ end }}
- {{ partial "article/components/related-contents" . }}
+ {{ partial "article/components/related-content" . }}
{{ if not (eq .Params.comments false) }}
{{ partial "comments/include" . }}
@@ -30,32 +41,6 @@
{{ partialCached "article/components/photoswipe" . }}
{{ end }}
-{{ define "left-sidebar" }}
- {{ if (.Scratch.Get "hasTOC") }}
-
- {{ else }}
- {{ partial "sidebar/left.html" . }}
- {{ end }}
-{{ end }}
-
{{ define "right-sidebar" }}
- {{ if (.Scratch.Get "hasTOC") }}
-
- {{ end }}
+ {{ if .Scratch.Get "hasWidget" }}{{ partial "sidebar/right.html" (dict "Context" . "Scope" "page") }}{{ end}}
{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index 576faef..0cd0b88 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -15,5 +15,5 @@
{{ end }}
{{ define "right-sidebar" }}
- {{ partial "sidebar/right.html" . }}
+ {{ partial "sidebar/right.html" (dict "Context" . "Scope" "homepage") }}
{{ end }}
\ No newline at end of file
diff --git a/layouts/page/search.html b/layouts/page/search.html
index 935b384..7c424a6 100644
--- a/layouts/page/search.html
+++ b/layouts/page/search.html
@@ -16,8 +16,10 @@
-
-
+
{{- end -}}
-
diff --git a/layouts/partials/comments/provider/twikoo.html b/layouts/partials/comments/provider/twikoo.html
index 30c7033..7dd3e50 100644
--- a/layouts/partials/comments/provider/twikoo.html
+++ b/layouts/partials/comments/provider/twikoo.html
@@ -1,4 +1,4 @@
-
+