1
0
forked from BgLUG/bglug.it

visualizzazione licenza post/evento (#223)

Visualizzazione della licenza indicata nel front-matter di un post/evento.
Supporta markdown.

Esempio:
```markdown
license: "[CC-BY-SA](https://rickroll.it)"
```

rif. #209

Reviewed-on: BgLUG/bglug.it#223
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
This commit is contained in:
Paolo Asperti 2024-09-13 21:42:06 +00:00 committed by Paolo Asperti
parent 15ae080843
commit 146ae02f84
8 changed files with 20 additions and 0 deletions

View File

@ -9,6 +9,8 @@ type: post
# image: image.png # if you don't specify an image, the first available is used # image: image.png # if you don't specify an image, the first available is used
# image_alt: description of the featured image. The image ratio should be 360x250. # image_alt: description of the featured image. The image ratio should be 360x250.
# image_caption: Image credits: author and license # image_caption: Image credits: author and license
# if not specified, CC-BY-SA is implied
# license: "[CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)"
summary: If not present, the content will be used instead summary: If not present, the content will be used instead
tags: tags:
- eventi - eventi

View File

@ -9,6 +9,8 @@ type: post
# image: image.png # se non metti un'immagine, viene presa la prima immagine del post # image: image.png # se non metti un'immagine, viene presa la prima immagine del post
# image_alt: "Descrizione dell'immagine. Il ratio dell'immagine deve essere 360x250." # image_alt: "Descrizione dell'immagine. Il ratio dell'immagine deve essere 360x250."
# image_caption: Credits dell'immagine: autore e licenza # image_caption: Credits dell'immagine: autore e licenza
# se non indicato, si intente CC-BY-SA
# license: "[CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)"
summary: Se non presente, usa il testo dell'articolo summary: Se non presente, usa il testo dell'articolo
tags: tags:
- eventi - eventi

View File

@ -9,6 +9,8 @@ type: post
# image: image.png # if you don't specify an image, the first available is used # image: image.png # if you don't specify an image, the first available is used
# image_alt: description of the featured image. The image ratio should be 360x250. # image_alt: description of the featured image. The image ratio should be 360x250.
# image_caption: Image credits: author and license # image_caption: Image credits: author and license
# if not specified, CC-BY-SA is implied
# license: "[CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)"
summary: If not present, the content will be used instead summary: If not present, the content will be used instead
tags: tags:
- news - news

View File

@ -9,6 +9,8 @@ type: post
# image: image.png # se non metti un'immagine, viene presa la prima immagine del post # image: image.png # se non metti un'immagine, viene presa la prima immagine del post
# image_alt: "Descrizione dell'immagine. Il ratio dell'immagine deve essere 360x250." # image_alt: "Descrizione dell'immagine. Il ratio dell'immagine deve essere 360x250."
# image_caption: Credits dell'immagine: autore e licenza # image_caption: Credits dell'immagine: autore e licenza
# se non indicato, si intente CC-BY-SA
# license: "[CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)"
summary: Se non presente, usa il testo dell'articolo summary: Se non presente, usa il testo dell'articolo
tags: tags:
- news - news

View File

@ -172,3 +172,8 @@ div.highlight pre code > span::before {
} }
} }
} }
article header div.license {
font-size: 1rem;
}

View File

@ -1 +1,3 @@
---
license: License
footer_license_note: Except where otherwise noted, content on this site is published under [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) license. footer_license_note: Except where otherwise noted, content on this site is published under [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) license.

View File

@ -1 +1,3 @@
---
license: Licenza
footer_license_note: Eccetto dove diversamente indicato, ogni contenuto di questo sito è pubblicato con licenza [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/). footer_license_note: Eccetto dove diversamente indicato, ogni contenuto di questo sito è pubblicato con licenza [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/).

View File

@ -8,6 +8,9 @@
{{ if .Site.Params.show_post_dates | default true }} {{ if .Site.Params.show_post_dates | default true }}
{{- with .Date }}<time>{{ . | time.Format ":date_medium" }}</time>{{ end }} {{- with .Date }}<time>{{ . | time.Format ":date_medium" }}</time>{{ end }}
{{ end }} {{ end }}
{{- with .Params.license -}}
<div class="license">{{ T "license" }}: {{ . | markdownify }}</div>
{{ end }}
{{ partial "tags.html" . }} {{ partial "tags.html" . }}
</header> </header>