This commit is contained in:
Christian Heusel 2025-06-10 17:00:28 +00:00 committed by GitHub
commit 3870bfef96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 46 additions and 1 deletions

View File

@ -186,6 +186,13 @@ disableKinds = ['taxonomy', 'taxonomyTerm']
# /!\ This is an experimental feature, might be removed or changed at any time # /!\ 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. # (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker = true 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 ### Multi-Language Support

View File

@ -14,6 +14,10 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.flex-gap {
gap: $padding-16;
}
.justify-start { .justify-start {
justify-content: flex-start; justify-content: flex-start;
} }

View File

@ -117,3 +117,10 @@ enableGitInfo = true
# /!\ This is an experimental feature, might be removed or changed at any time # /!\ 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. # (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly = false 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/'

View File

@ -113,3 +113,10 @@ params:
# /!\ This is an experimental feature, might be removed or changed at any time # /!\ 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. # (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly: false 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/

View File

@ -1,4 +1,4 @@
<div class="flex flex-wrap justify-between"> <div class="flex flex-wrap flex-gap justify-between">
{{ if and .GitInfo .Site.Params.BookRepo }} {{ if and .GitInfo .Site.Params.BookRepo }}
<div> <div>
@ -19,6 +19,22 @@
</div> </div>
{{ end }} {{ end }}
{{ if and .File .Site.Params.BookContentLicenseText }}
<div>
{{ if and .File .Site.Params.BookContentLicenseLink }}
<a class="flex align-center" href="{{ .Site.Params.BookContentLicenseLink }}" title='License' target="_blank" rel="noopener">
<img src="{{ "svg/license.svg" | relURL }}" class="book-icon" alt="" />
<span>{{ .Site.Params.BookContentLicenseText }}</span>
</a>
{{ else }}
<span>
<img src="{{ "svg/license.svg" | relURL }}" class="book-icon" alt="" />
{{ .Site.Params.BookContentLicenseText }}
</span>
{{ end }}
</div>
{{ end }}
</div> </div>
{{ $script := resources.Get "clipboard.js" | resources.Minify }} {{ $script := resources.Get "clipboard.js" | resources.Minify }}

4
static/svg/license.svg Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 19V6.2C4 5.0799 4 4.51984 4.21799 4.09202C4.40973 3.71569 4.71569 3.40973 5.09202 3.21799C5.51984 3 6.0799 3 7.2 3H16.8C17.9201 3 18.4802 3 18.908 3.21799C19.2843 3.40973 19.5903 3.71569 19.782 4.09202C20 4.51984 20 5.0799 20 6.2V17H6C4.89543 17 4 17.8954 4 19ZM4 19C4 20.1046 4.89543 21 6 21H20M9 7H15M9 11H15M19 17V21" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 642 B