Skip to content

Commit e000c1e

Browse files
committed
add option to include a privacy policy and legal notice page
1 parent 7cceca5 commit e000c1e

File tree

6 files changed

+42
-6
lines changed

6 files changed

+42
-6
lines changed

exampleSite/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ params:
2525

2626
geekdocDateFormat: "Jan 2, 2006"
2727
geekdocSearch: true
28+
29+
geekdocLegalNotice: https://geeklabor.de/legal-notice/#impressum
30+
geekdocPrivacyPolicy: https://geeklabor.de/legal-notice/#datenschutzerkl%C3%A4rung

exampleSite/content/usage/configuration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
# (Optional, default true) Enables search function with flexsearch.
4242
# Index is built on the fly and might slowdown your website.
4343
geekdocSearch = false
44+
45+
# (Optional, default none) Add a link to your Legal Notice page to the site footer.
46+
# It can be either a remote url or a local file path relative to your content directory.
47+
geekdocLegalNotice = 'https://blog.example.com/legal'
48+
49+
# (Optional, default none) Add a link to your Privacy Policy page to the site footer.
50+
# It can be either a remote url or a local file path relative to your content directory.
51+
geekdocPrivacyPolicy = '/privacy'
4452
```
4553

4654
{{< /tab >}}
@@ -85,6 +93,14 @@ params:
8593
# (Optional, default true) Enables search function with flexsearch.
8694
# Index is built on the fly and might slowdown your website.
8795
geekdocSearch: false
96+
97+
# (Optional, default none) Add a link to your Legal Notice page to the site footer.
98+
# It can be either a remote url or a local file path relative to your content directory.
99+
geekdocLegalNotice: https://blog.example.com/legal
100+
101+
# (Optional, default none) Add a link to your Privacy Policy page to the site footer.
102+
# It can be either a remote url or a local file path relative to your content directory.
103+
geekdocPrivacyPolicy: /privacy
88104
```
89105
90106
{{< /tab >}}

layouts/partials/page-footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{{ end }}
4444

4545

46-
<div class="gdoc-page__footer flex justify-between">
46+
<div class="gdoc-page__footer flex flex-wrap justify-between">
4747
{{ $showPrevNext := (and (not .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
4848
{{ if $showPrevNext }}
4949
<span>

layouts/partials/page-header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{end}}
1717
{{end}}
1818

19-
<div class="gdoc-page__header flex justify-between{{ if not $geekdocRepo }} hidden-mobile{{ end }}" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
19+
<div class="gdoc-page__header flex flex-wrap justify-between{{ if not $geekdocRepo }} hidden-mobile{{ end }}" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
2020
{{$showBreadcrumb := (and (not .Page.Params.geekdocBreadcrumb) (not .Site.Params.geekdocBreadcrumb))}}
2121
<span>
2222
{{if $showBreadcrumb}}

layouts/partials/site-footer.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
<footer class="gdoc-footer">
2-
<div class="container flex">
3-
<span>
2+
<div class="container flex flex-wrap">
3+
<span class="gdoc-footer__item">
44
Build with <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> and
55
<svg class="icon heart"><use xlink:href="#heart"></use></svg>
66
</span>
7-
<span>
7+
{{ with .Site.Params.GeekdocLegalNotice }}
8+
<span class="gdoc-footer__item">
9+
<a href="{{ . | relURL }}" class="gdoc-footer__link">Legal Notice</a>
10+
</span>
11+
{{ end }}
12+
{{ with .Site.Params.GeekdocPrivacyPolicy }}
13+
<span class="gdoc-footer__item">
14+
<a href="{{ . | relURL }}" class="gdoc-footer__link">Privacy Policy</a>
15+
</span>
16+
{{ end }}
817
</div>
918
</footer>

src/sass/_base.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ img {
188188
&__header,
189189
&__footer {
190190
margin-bottom: $padding-16 * 1.2;
191-
flex-wrap: wrap;
192191

193192
.icon {
194193
color: $gray-600;
@@ -260,6 +259,11 @@ img {
260259
background: $second-color;
261260
color: $white;
262261

262+
&__item {
263+
margin-right: 1em;
264+
line-height: 1.5em;
265+
}
266+
263267
&__link {
264268
color: $color-link-footer;
265269

@@ -457,6 +461,10 @@ img {
457461
display: none;
458462
}
459463

464+
.gdoc-footer__item {
465+
width: 100%;
466+
}
467+
460468
#menu-control:checked ~ main {
461469
.gdoc-nav nav,
462470
.gdoc-page {

0 commit comments

Comments
 (0)