add option to include a privacy policy and legal notice page

master
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" geekdocDateFormat: "Jan 2, 2006"
geekdocSearch: true 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. # (Optional, default true) Enables search function with flexsearch.
# Index is built on the fly and might slowdown your website. # Index is built on the fly and might slowdown your website.
geekdocSearch = false 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 >}} {{< /tab >}}
@ -85,6 +93,14 @@ params:
# (Optional, default true) Enables search function with flexsearch. # (Optional, default true) Enables search function with flexsearch.
# Index is built on the fly and might slowdown your website. # Index is built on the fly and might slowdown your website.
geekdocSearch: false 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 >}} {{< /tab >}}

View File

@ -43,7 +43,7 @@
{{ end }} {{ 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) }} {{ $showPrevNext := (and (not .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
{{ if $showPrevNext }} {{ if $showPrevNext }}
<span> <span>

View File

@ -16,7 +16,7 @@
{{end}} {{end}}
{{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))}} {{$showBreadcrumb := (and (not .Page.Params.geekdocBreadcrumb) (not .Site.Params.geekdocBreadcrumb))}}
<span> <span>
{{if $showBreadcrumb}} {{if $showBreadcrumb}}

View File

@ -1,9 +1,18 @@
<footer class="gdoc-footer"> <footer class="gdoc-footer">
<div class="container flex"> <div class="container flex flex-wrap">
<span> <span class="gdoc-footer__item">
Build with <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> and Build with <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> and
<svg class="icon heart"><use xlink:href="#heart"></use></svg> <svg class="icon heart"><use xlink:href="#heart"></use></svg>
</span> </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> </div>
</footer> </footer>

View File

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