From 7df6057ca0c041bb9f090ae1db5d051e3a5eaa8e Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 16 Feb 2022 11:53:13 +0100 Subject: [PATCH] feat: add new option geekdocContentLicense (#346) --- exampleSite/content/en/usage/configuration.md | 12 +++++ i18n/de.yaml | 2 + i18n/en.yaml | 2 + layouts/partials/microformats/schema.html | 6 +++ layouts/partials/site-footer.html | 44 ++++++++++++------- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/exampleSite/content/en/usage/configuration.md b/exampleSite/content/en/usage/configuration.md index f931fee..8d497e0 100644 --- a/exampleSite/content/en/usage/configuration.md +++ b/exampleSite/content/en/usage/configuration.md @@ -116,6 +116,12 @@ enableRobotsTXT = true # 'date', 'publishdate', 'expirydate' or 'lastmod'. Every option can be used with a reverse modifier as well # e.g. 'title_reverse'. geekdocFileTreeSortBy = "title" + + # (Optional, default none) Adds a "Content licensed under " line to the footer. + # Could be used if you want to define a default license for your content. + [params.geekdocContentLicense] + name = "CC BY-SA 4.0" + link = "https://creativecommons.org/licenses/by-sa/4.0/" ``` {{< /tab >}} @@ -229,6 +235,12 @@ params: # 'date', 'publishdate', 'expirydate' or 'lastmod'. Every option can be used with a reverse modifier as well # e.g. 'title_reverse'. geekdocFileTreeSortBy: "title" + + # (Optional, default none) Adds a "Content licensed under " line to the footer. + # Could be used if you want to define a default license for your content. + geekdocContentLicense: + name: CC BY-SA 4.0 + link: https://creativecommons.org/licenses/by-sa/4.0/ ``` {{< /tab >}} diff --git a/i18n/de.yaml b/i18n/de.yaml index c45f870..d0637c4 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -39,5 +39,7 @@ footer_build_with: > footer_legal_notice: Impressum footer_privacy_policy: Datenschutzerklärung +footer_content_license_prefix: > + Inhalt lizensiert unter language_switch_no_tranlation_prefix: "Seite nicht übersetzt:" diff --git a/i18n/en.yaml b/i18n/en.yaml index 4f1e4e9..9ee768b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -39,5 +39,7 @@ footer_build_with: > footer_legal_notice: Legal Notice footer_privacy_policy: Privacy Policy +footer_content_license_prefix: > + Content licensed under language_switch_no_tranlation_prefix: "Page not translated:" diff --git a/layouts/partials/microformats/schema.html b/layouts/partials/microformats/schema.html index b72a8c7..1e67bf7 100644 --- a/layouts/partials/microformats/schema.html +++ b/layouts/partials/microformats/schema.html @@ -11,6 +11,9 @@ {{- with partial "utils/featured" . }} "thumbnailUrl": {{ . }}, {{- end }} + {{- with .Site.Params.GeekdocContentLicense }} + "license": "{{ .name }}", + {{- end }} "inLanguage": {{ .Lang }} } @@ -33,6 +36,9 @@ "thumbnailUrl": {{ . }}, {{- end }} "wordCount" : "{{ .WordCount }}", + {{- with .Site.Params.GeekdocContentLicense }} + "license": "{{ .name }}", + {{- end }} "inLanguage": {{ .Lang }}, "isFamilyFriendly": "true", "mainEntityOfPage": { diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html index 862fb4f..d7afc1e 100644 --- a/layouts/partials/site-footer.html +++ b/layouts/partials/site-footer.html @@ -1,22 +1,32 @@