diff options
author | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2016-03-08 16:56:40 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2016-03-08 16:58:44 +0300 |
commit | d0fcabe2fbd5e0d5d6f29b6c8d19699e5b11fdde (patch) | |
tree | 71ced03caf7ac009bcfe0ad80b801703dd865e0b | |
parent | c7dcfa6548cc71c48d39bba6367aea7d15203b37 (diff) |
Add option to disable profile / widgets
Can be controlled in the frontmatter. The full width
will be used for the content if both are disabled.
Fixes #29.
-rw-r--r-- | exampleSite/content/post/introducing-icarus-and-its-features.md | 12 | ||||
-rw-r--r-- | layouts/_default/single.html | 6 | ||||
-rw-r--r-- | layouts/partials/head.html | 8 | ||||
-rw-r--r-- | layouts/partials/single_article.html | 4 |
4 files changed, 30 insertions, 0 deletions
diff --git a/exampleSite/content/post/introducing-icarus-and-its-features.md b/exampleSite/content/post/introducing-icarus-and-its-features.md index 9faf55b..c45386b 100644 --- a/exampleSite/content/post/introducing-icarus-and-its-features.md +++ b/exampleSite/content/post/introducing-icarus-and-its-features.md @@ -83,6 +83,18 @@ Furthermore, we can add entries that don't link to posts. Back in the `config.to Define a label and enter the URL to resource you want to link. With `before` you can decide whether the link should appear before **or** after all linked posts in the menu. `Home` appears before the linked post, `Tags` and `Categories` after them (as in the menu above). +### Sidebars + +In order to use the full width of the website you can disable the profile on the left and / or the widgets on the right for a single page in the frontmatter: + +```toml ++++ +disable_profile = true +disable_widgets = true ++++ +``` + + ### Tell me who you are Maybe you noticed the profile section on the left. Add your social network accounts to the profile section on the left by entering your username under `social`. The links to your account will be create automatically. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6ceca03..91ae34f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,9 +4,15 @@ {{ partial "header" . }} <div class="outer"> + {{ if .IsPage | and (not .Params.disable_profile) }} {{ partial "profile" . }} + {{ end }} + {{ partial "single_article" . }} + + {{ if .IsPage | and (not .Params.disable_widgets) }} {{ partial "sidebar" . }} + {{ end }} </div> </div> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index cb28f43..d97a90a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -28,6 +28,14 @@ {{ template "_internal/schema.html" . }} {{ template "_internal/twitter_cards.html" . }} {{ partial "head_custom" . }} + + {{ if .Params.disable_profile | and .Params.disable_widgets }} + <style> + .full-width { + width: 100% !important; + } + </style> + {{ end }} </head> <body> <div class="container"> diff --git a/layouts/partials/single_article.html b/layouts/partials/single_article.html index 7449eb3..e8a296f 100644 --- a/layouts/partials/single_article.html +++ b/layouts/partials/single_article.html @@ -1,4 +1,8 @@ +{{ if .Params.disable_profile | and .Params.disable_widgets }} +<section id="main" class="full-width"> +{{ else }} <section id="main"> +{{ end }} <article id="page-undefined" class="article article-type-page" itemscope="" itemprop="blogPost"> <div class="article-inner"> {{ if and (isset .Params "banner") (not (eq .Params.banner "")) }} |