Skip to content

Commit

Permalink
add option to include a privacy policy and legal notice page
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys committed Feb 5, 2020
1 parent 7cceca5 commit e000c1e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
3 changes: 3 additions & 0 deletions exampleSite/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions exampleSite/content/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/page-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/page-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
15 changes: 12 additions & 3 deletions layouts/partials/site-footer.html
Original file line number Diff line number Diff line change
@@ -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>
10 changes: 9 additions & 1 deletion src/sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ img {
&__header,
&__footer {
margin-bottom: $padding-16 * 1.2;
flex-wrap: wrap;

.icon {
color: $gray-600;
Expand Down Expand Up @@ -260,6 +259,11 @@ img {
background: $second-color;
color: $white;

&__item {
margin-right: 1em;
line-height: 1.5em;
}

&__link {
color: $color-link-footer;

Expand Down Expand Up @@ -457,6 +461,10 @@ img {
display: none;
}

.gdoc-footer__item {
width: 100%;
}

#menu-control:checked ~ main {
.gdoc-nav nav,
.gdoc-page {
Expand Down

0 comments on commit e000c1e

Please sign in to comment.