diff --git a/layouts/pages/list.html b/layouts/pages/list.html index 3a0bf4f3992b70f9cf57350918b919e52f012885..3e9183bfd79e27a28802147e1877a418b5abbac6 100644 --- a/layouts/pages/list.html +++ b/layouts/pages/list.html @@ -2,46 +2,14 @@ {{ partial "pages/hero.html" . }} <div class="document-content"> - - {{/* TOC PART */}} {{- $category := site.GetPage (printf "/categories%s" .Params.category) -}} - {{- $show_aside := false -}} - - {{- $has_blocks := false -}} - {{- range .Params.blocks -}} - {{- $has_blocks = true -}} - {{- if .title -}} - {{- $show_aside = true -}} - {{- end -}} - {{- end -}} - - {{- if .Pages -}} - {{- if eq $has_blocks false -}} - {{- $show_aside = true -}} - {{- end -}} - {{- end -}} - - {{- if .Content -}} - {{- if eq $has_blocks false -}} - {{- $show_aside = true -}} - {{- end -}} - {{- end -}} - - {{- if $category -}} - {{- if eq $has_blocks false -}} - {{- $show_aside = true -}} - {{- end -}} - {{- end -}} - - {{- if $show_aside }} - {{ partial "toc/container.html" - (dict - "category" $category - "toc" "pages/toc.html" - "context" . - ) - }} - {{ end }} + {{ partial "toc/container.html" + (dict + "category" $category + "toc" "pages/toc.html" + "context" . + ) + }} {{ partial "hooks/after-page-hero.html" . }} diff --git a/layouts/partials/GetBodyclass b/layouts/partials/GetBodyclass index 96ab6fafa8a1337a5c7c29487fa628279ffc088b..5349630ba5ea3346051a78f1f2825e5f840ec136 100644 --- a/layouts/partials/GetBodyclass +++ b/layouts/partials/GetBodyclass @@ -8,7 +8,7 @@ {{- $bodyclass = printf "full-width %s" $bodyclass -}} {{- end -}} -{{- if .Params.layout.offcanvas -}} +{{- if .Params.layout.toc.offcanvas -}} {{- $bodyclass = printf "offcanvas-toc %s" $bodyclass -}} {{- end -}} diff --git a/layouts/partials/IsTocNeeded b/layouts/partials/IsTocNeeded index c0ec4cc76f787daef95fca1083704ea95271efe7..01901125c9ac93274e24f383022319868d3cbf61 100644 --- a/layouts/partials/IsTocNeeded +++ b/layouts/partials/IsTocNeeded @@ -1,13 +1 @@ -{{ $isNeeded := false }} - -{{ if eq .context.Type "programs" }} - {{ $isNeeded = true }} -{{ end }} - -{{ if .context.Params.blocks }} - {{ if gt (len .context.Params.blocks) 1 }} - {{ $isNeeded = true }} - {{ end }} -{{ end }} - -{{ return $isNeeded }} \ No newline at end of file +{{ return .context.Params.layout.toc.present }} \ No newline at end of file diff --git a/layouts/partials/programs/single.html b/layouts/partials/programs/single.html index 5248c78232f5f47352dbddbae63ee24f85f6106e..44e430b0920830f605acd18dbb9f67593cb4d5c0 100644 --- a/layouts/partials/programs/single.html +++ b/layouts/partials/programs/single.html @@ -1,12 +1,15 @@ <div class="document-content" itemscope itemtype="https://schema.org/EducationalOccupationalCredential"> + + <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> + <meta itemprop="url" content="{{ .Permalink }}"> + {{ partial "toc/container.html" - (dict + (dict "toc" "programs/toc.html" "context" . ) - }} - <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> - <meta itemprop="url" content="{{ .Permalink }}"> + }} + {{- if .Params.image -}} {{- $id := .Params.image -}} {{- if isset .Params.image "id" -}} diff --git a/layouts/partials/toc/default.html b/layouts/partials/toc/default.html index ae57cd0f5adb72ebaa6b374c6581d3cca8a458b5..2f071f86070095fd90a5e49119c8a745149cd551 100644 --- a/layouts/partials/toc/default.html +++ b/layouts/partials/toc/default.html @@ -1,40 +1,7 @@ -{{- $show_aside := false -}} - -{{- $has_blocks := false -}} -{{- range .context.Params.blocks -}} - {{- $has_blocks = true -}} - {{- if .title -}} - {{- $show_aside = true -}} - {{- end -}} -{{- end -}} - -{{- if .context.Pages -}} - {{- if eq $has_blocks false -}} - {{- $show_aside = true -}} - {{- end -}} -{{- end -}} - -{{- if .context.Content -}} - {{- if eq $has_blocks false -}} - {{- $show_aside = true -}} - {{- end -}} -{{- end -}} - -{{- if .category -}} - {{- if eq $has_blocks false -}} - {{- $show_aside = true -}} - {{- end -}} -{{- end -}} - -{{- if $show_aside }} - <nav class="toc toc-pages" id="nav-toc" aria-labelledby="toc-title"> - <ol> - {{- if .context.Params.blocks -}} - {{- partial "blocks/toc.html" .context.Params.blocks -}} - {{- end -}} - </ol> - </nav> - -{{ end -}} - - +<nav class="toc toc-pages" id="nav-toc" aria-labelledby="toc-title"> + <ol> + {{- if .context.Params.blocks -}} + {{- partial "blocks/toc.html" .context.Params.blocks -}} + {{- end -}} + </ol> +</nav> diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 562c3c3a7584fbabfae0605a9fa4e3fc67193e51..9a7f30264a8ac65f73b33fa9dd30a5b4a1724d7e 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -2,6 +2,11 @@ {{ partial "posts/hero-single.html" . }} <div class="document-content" itemscope itemtype="https://schema.org/NewsArticle"> + <meta itemprop="headline" content="{{ partial "PrepareHTML" .Title }}"> + <meta itemprop="url" content="{{ .Permalink }}"> + {{ if .Date }}<meta itemprop="datePublished" content="{{ .Date.Format "2006-01-02T15:04" }}">{{ end }} + {{ if .Params.description_short }}<meta itemprop="abstract" content="{{ partial "PrepareHTML" .Params.description_short }}">{{ end }} + {{ if .Summary }}<meta itemprop="description" content="{{ partial "PrepareHTML" .Summary }}">{{ end }} {{ partial "toc/container.html" (dict @@ -10,15 +15,8 @@ ) }} - <meta itemprop="headline" content="{{ partial "PrepareHTML" .Title }}"> - <meta itemprop="url" content="{{ .Permalink }}"> - {{ if .Date }}<meta itemprop="datePublished" content="{{ .Date.Format "2006-01-02T15:04" }}">{{ end }} - {{ if .Params.description_short }}<meta itemprop="abstract" content="{{ partial "PrepareHTML" .Params.description_short }}">{{ end }} - {{ if .Summary }}<meta itemprop="description" content="{{ partial "PrepareHTML" .Summary }}">{{ end }} - {{ partial "posts/aside.html" . }} - {{ partial "posts/chapo.html" (dict "context" . "block_wrapped" true