From 90bdc34eb837985f8135bd5f1f57b484e0b50300 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 6 Sep 2020 14:02:48 +0200 Subject: [PATCH] feat(article): custom license per article --- exampleSite/content/page/about.md | 1 + layouts/partials/article/components/footer.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/page/about.md b/exampleSite/content/page/about.md index f49aec5..46a3b3e 100644 --- a/exampleSite/content/page/about.md +++ b/exampleSite/content/page/about.md @@ -4,6 +4,7 @@ description = "Hugo, the world's fastest framework for building websites" date = "2019-02-28" aliases = ["about-us", "about-hugo", "contact"] author = "Hugo Authors" +license = "CC BY-NC-ND" +++ Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index 39d5b58..ab46dc7 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -7,10 +7,10 @@ {{ end }} - {{ if .Site.Params.article.license.enabled }} + {{ if and (.Site.Params.article.license.enabled) (not (eq .Params.license false)) }}
{{ (resources.Get "icons/copyright.svg").Content | safeHTML }} - {{ .Site.Params.article.license.default }} + {{ default .Site.Params.article.license.default .Params.license }}
{{ end }} \ No newline at end of file