Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit d0fcabe

Browse files
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.
1 parent c7dcfa6 commit d0fcabe

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

exampleSite/content/post/introducing-icarus-and-its-features.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ Furthermore, we can add entries that don't link to posts. Back in the `config.to
8383
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).
8484

8585

86+
### Sidebars
87+
88+
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:
89+
90+
```toml
91+
+++
92+
disable_profile = true
93+
disable_widgets = true
94+
+++
95+
```
96+
97+
8698
### Tell me who you are
8799

88100
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.

layouts/_default/single.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
{{ partial "header" . }}
55

66
<div class="outer">
7+
{{ if .IsPage | and (not .Params.disable_profile) }}
78
{{ partial "profile" . }}
9+
{{ end }}
10+
811
{{ partial "single_article" . }}
12+
13+
{{ if .IsPage | and (not .Params.disable_widgets) }}
914
{{ partial "sidebar" . }}
15+
{{ end }}
1016
</div>
1117
</div>
1218

layouts/partials/head.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
{{ template "_internal/schema.html" . }}
2929
{{ template "_internal/twitter_cards.html" . }}
3030
{{ partial "head_custom" . }}
31+
32+
{{ if .Params.disable_profile | and .Params.disable_widgets }}
33+
<style>
34+
.full-width {
35+
width: 100% !important;
36+
}
37+
</style>
38+
{{ end }}
3139
</head>
3240
<body>
3341
<div class="container">

layouts/partials/single_article.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
{{ if .Params.disable_profile | and .Params.disable_widgets }}
2+
<section id="main" class="full-width">
3+
{{ else }}
14
<section id="main">
5+
{{ end }}
26
<article id="page-undefined" class="article article-type-page" itemscope="" itemprop="blogPost">
37
<div class="article-inner">
48
{{ if and (isset .Params "banner") (not (eq .Params.banner "")) }}

0 commit comments

Comments
 (0)