add option to include a privacy policy and legal notice page

This commit is contained in:
Robert Kaussow 2020-02-05 01:15:51 +01:00
parent 7cceca5a72
commit e000c1e461
6 changed files with 42 additions and 6 deletions

View File

@ -25,3 +25,6 @@ params:
geekdocDateFormat: "Jan 2, 2006"
geekdocSearch: true
geekdocLegalNotice: https://geeklabor.de/legal-notice/#impressum
geekdocPrivacyPolicy: https://geeklabor.de/legal-notice/#datenschutzerkl%C3%A4rung

View File

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

View File

@ -43,7 +43,7 @@
{{ end }}
<div class="gdoc-page__footer flex justify-between">
<div class="gdoc-page__footer flex flex-wrap justify-between">
{{ $showPrevNext := (and (not .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
{{ if $showPrevNext }}
<span>

View File

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

View File

@ -1,9 +1,18 @@
<footer class="gdoc-footer">
<div class="container flex">
<span>
<div class="container flex flex-wrap">
<span class="gdoc-footer__item">
Build with <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> and
<svg class="icon heart"><use xlink:href="#heart"></use></svg>
</span>
<span>
{{ with .Site.Params.GeekdocLegalNotice }}
<span class="gdoc-footer__item">
<a href="{{ . | relURL }}" class="gdoc-footer__link">Legal Notice</a>
</span>
{{ end }}
{{ with .Site.Params.GeekdocPrivacyPolicy }}
<span class="gdoc-footer__item">
<a href="{{ . | relURL }}" class="gdoc-footer__link">Privacy Policy</a>
</span>
{{ end }}
</div>
</footer>

View File

@ -188,7 +188,6 @@ img {
&__header,
&__footer {
margin-bottom: $padding-16 * 1.2;
flex-wrap: wrap;
.icon {
color: $gray-600;
@ -260,6 +259,11 @@ img {
background: $second-color;
color: $white;
&__item {
margin-right: 1em;
line-height: 1.5em;
}
&__link {
color: $color-link-footer;
@ -457,6 +461,10 @@ img {
display: none;
}
.gdoc-footer__item {
width: 100%;
}
#menu-control:checked ~ main {
.gdoc-nav nav,
.gdoc-page {