From e295d4b9a5d865a6f178be4a0d1191ea9e890918 Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Thu, 2 Jan 2025 16:00:49 +0100 Subject: [PATCH 1/2] Add Parameters for a page content license This allows people to specify which License conditions apply for the content they're hosting. Signed-off-by: Christian Heusel --- README.md | 7 +++++++ exampleSite/hugo.toml | 7 +++++++ exampleSite/hugo.yaml | 7 +++++++ layouts/_partials/docs/footer.html | 16 ++++++++++++++++ static/svg/license.svg | 4 ++++ 5 files changed, 41 insertions(+) create mode 100644 static/svg/license.svg diff --git a/README.md b/README.md index f37dc81..5452231 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,13 @@ disableKinds = ['taxonomy', 'taxonomyTerm'] # /!\ This is an experimental feature, might be removed or changed at any time # (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use. BookServiceWorker = true + + # (Optional) Specifies a License that applies to the content of the page + # BookContentLicenseText = 'CC-BY-SA-4.0' + + # (Optional) Specifies a Link for the License that applies to the content of the page + # Requires 'BookContentLicenseText' param. + # BookContentLicenseLink = 'https://creativecommons.org/licenses/by-sa/4.0/' ``` ### Multi-Language Support diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 34af293..f95a202 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -117,3 +117,10 @@ enableGitInfo = true # /!\ This is an experimental feature, might be removed or changed at any time # (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present. BookTranslatedOnly = false + + # (Optional) Specifies a License that applies to the content of the page + # BookContentLicenseText = 'CC-BY-SA-4.0' + + # (Optional) Specifies a Link for the License that applies to the content of the page + # Requires 'BookContentLicenseText' param. + # BookContentLicenseLink = 'https://creativecommons.org/licenses/by-sa/4.0/' diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 3fd0c40..81102b2 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -113,3 +113,10 @@ params: # /!\ This is an experimental feature, might be removed or changed at any time # (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present. BookTranslatedOnly: false + + # (Optional) Specifies a License that applies to the content of the page + # BookContentLicenseText: CC-BY-SA-4.0 + + # (Optional) Specifies a Link for the License that applies to the content of the page + # Requires 'BookContentLicenseText' param. + # BookContentLicenseLink: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/layouts/_partials/docs/footer.html b/layouts/_partials/docs/footer.html index 77e96d8..51cdaa5 100644 --- a/layouts/_partials/docs/footer.html +++ b/layouts/_partials/docs/footer.html @@ -19,6 +19,22 @@ {{ end }} +{{ if and .File .Site.Params.BookContentLicenseText }} +
+ {{ if and .File .Site.Params.BookContentLicenseLink }} + + + {{ .Site.Params.BookContentLicenseText }} + + {{ else }} + + + {{ .Site.Params.BookContentLicenseText }} + + {{ end }} +
+{{ end }} + {{ $script := resources.Get "clipboard.js" | resources.Minify }} diff --git a/static/svg/license.svg b/static/svg/license.svg new file mode 100644 index 0000000..8e0b32a --- /dev/null +++ b/static/svg/license.svg @@ -0,0 +1,4 @@ + + + + From c8e2f85fa169aea2897229d70002571de962716f Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Sat, 31 May 2025 16:59:02 +0200 Subject: [PATCH 2/2] Add a gap between footer items --- assets/_utils.scss | 4 ++++ layouts/_partials/docs/footer.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/_utils.scss b/assets/_utils.scss index 92fad0f..49e9d2d 100644 --- a/assets/_utils.scss +++ b/assets/_utils.scss @@ -14,6 +14,10 @@ flex-wrap: wrap; } +.flex-gap { + gap: $padding-16; +} + .justify-start { justify-content: flex-start; } diff --git a/layouts/_partials/docs/footer.html b/layouts/_partials/docs/footer.html index 51cdaa5..3bf3cde 100644 --- a/layouts/_partials/docs/footer.html +++ b/layouts/_partials/docs/footer.html @@ -1,4 +1,4 @@ -
+
{{ if and .GitInfo .Site.Params.BookRepo }}