From 8d7df18bf04024c9eaa2f315ca5f67c30e257440 Mon Sep 17 00:00:00 2001 From: Stefan M Date: Sun, 16 Dec 2018 00:10:47 +0100 Subject: [PATCH] Allow single pages (#35) * Let users create single sites * Create shortcodes for bulma (sub)titles * Support sidebar in singlepages only * Fix shortcodes according to the bulma doc * Use h5 tag for is-5 class --- layouts/_default/single.html | 29 ++++++++++++++++++++++++++++ layouts/partials/navbar-clone.html | 3 +++ layouts/partials/navbar.html | 3 +++ layouts/partials/single/content.html | 12 ++++++++++++ layouts/partials/single/sidebar.html | 20 +++++++++++++++++++ layouts/partials/single/single.html | 3 +++ layouts/shortcodes/subtitle1.html | 1 + layouts/shortcodes/subtitle2.html | 1 + layouts/shortcodes/subtitle3.html | 1 + layouts/shortcodes/subtitle4.html | 1 + layouts/shortcodes/subtitle5.html | 1 + layouts/shortcodes/subtitle6.html | 1 + layouts/shortcodes/title1.html | 1 + layouts/shortcodes/title2.html | 1 + layouts/shortcodes/title3.html | 1 + layouts/shortcodes/title4.html | 1 + layouts/shortcodes/title5.html | 1 + layouts/shortcodes/title6.html | 1 + 18 files changed, 82 insertions(+) create mode 100644 layouts/_default/single.html create mode 100644 layouts/partials/single/content.html create mode 100644 layouts/partials/single/sidebar.html create mode 100644 layouts/partials/single/single.html create mode 100644 layouts/shortcodes/subtitle1.html create mode 100644 layouts/shortcodes/subtitle2.html create mode 100644 layouts/shortcodes/subtitle3.html create mode 100644 layouts/shortcodes/subtitle4.html create mode 100644 layouts/shortcodes/subtitle5.html create mode 100644 layouts/shortcodes/subtitle6.html create mode 100644 layouts/shortcodes/title1.html create mode 100644 layouts/shortcodes/title2.html create mode 100644 layouts/shortcodes/title3.html create mode 100644 layouts/shortcodes/title4.html create mode 100644 layouts/shortcodes/title5.html create mode 100644 layouts/shortcodes/title6.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..7ac3c1f --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,29 @@ + + + + {{ partial "meta.html" . }} + {{ block "title" . }}{{ .Site.Title }}{{ end }} + {{ partial "css.html" . }} + + + +
+
+
+ + {{ block "main" . }} + + {{ partial "single/single.html" . }} + + +
+ + {{ if .Params.sidebar }} + {{ partial "single/sidebar.html" . }} + {{ end }} + + {{ end }} + + {{ partial "javascript.html" . }} + + diff --git a/layouts/partials/navbar-clone.html b/layouts/partials/navbar-clone.html index f3beb11..431ec4d 100644 --- a/layouts/partials/navbar-clone.html +++ b/layouts/partials/navbar-clone.html @@ -1,5 +1,8 @@ {{- $navbar := .Site.Params.navbar }} {{- $sidebarVisible := .Site.Params.sidebar }} +{{ if .Params.sidebar }} +{{ $sidebarVisible = .Params.sidebar }} +{{ end }} {{- $navbarLogo := .Site.Params.navbarlogo }}