From b056f13dc9322a55288433a167841de592124937 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 24 Apr 2022 08:54:54 +0200 Subject: Add sidebar support --- layouts/_default/baseof.html | 6 ++++++ layouts/partials/head.html | 19 ++++++++----------- layouts/partials/sidebar-toc.html | 0 layouts/partials/sidebar.html | 0 4 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 layouts/partials/sidebar-toc.html create mode 100644 layouts/partials/sidebar.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 88882e5..13630ce 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,6 +2,12 @@ {{- partial "head.html" . -}} + + {{- if .Params.toc -}} + {{- partial "sidebar-toc.html" . -}} + {{- else -}} + {{- partial "sidebar.html" . -}} + {{- end -}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a324697..1518319 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,8 +1,6 @@ - {{- $resource_url := print .Site.BaseURL | safeURL -}} - {{- $title := print .Title -}} - {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} + {{- if .IsHome }}{{ $title = .Site.Title }}{{ end -}} {{- $description := print .Params.Description -}} {{- if or .IsHome (eq .Params.Description "") (not .Params.Description) -}} @@ -11,7 +9,6 @@ {{- $author := print .Site.Author.name -}} {{- if .Params.author -}}{{ $author = .Params.author }}{{- end -}} - @@ -22,20 +19,21 @@ {{ $title }} + - {{ if .Params.editor }}{{ end }} - {{ if .Params.pub_date }}{{ end }} - {{ if .Params.rights }}{{ end }} + {{- if .Params.editor }}{{ end }} + {{- if .Params.pub_date }}{{ end }} + {{- if .Params.rights }}{{ end }} - + {{- /* TODO: add fb:admins and fb:app_id */ -}} @@ -43,13 +41,12 @@ {{- /* TODO: add ability to render 'article' type */ -}} - - {{ $sass := resources.Get "sass/style.scss" -}} - {{ $style := $sass | resources.ToCSS | resources.Minify | resources.Fingerprint -}} + {{- $sass := resources.Get "sass/style.scss" }} + {{- $style := $sass | resources.ToCSS | resources.Minify | resources.Fingerprint }} diff --git a/layouts/partials/sidebar-toc.html b/layouts/partials/sidebar-toc.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3