diff options
author | Valentin Heinz <inktrap@users.noreply.github.com> | 2017-04-08 14:03:25 +0200 |
---|---|---|
committer | Alexis Metaireau <alexis@notmyidea.org> | 2017-04-08 14:03:25 +0200 |
commit | 5c231ceade17e7f5b1bba90e845dd2d17e54da1c (patch) | |
tree | f4f07dbbac2c51c8a0af1e1a24f11e030a2e4155 /uikit/templates/cc_license.html | |
parent | 00986ab80df4b6be2d1306671907e2b2378e487f (diff) | |
download | pelican-themes-5c231ceade17e7f5b1bba90e845dd2d17e54da1c.tar.gz |
uikit demo theme ported to pelican (#385)
Diffstat (limited to 'uikit/templates/cc_license.html')
-rw-r--r-- | uikit/templates/cc_license.html | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/uikit/templates/cc_license.html b/uikit/templates/cc_license.html new file mode 100644 index 0000000..0311232 --- /dev/null +++ b/uikit/templates/cc_license.html @@ -0,0 +1,53 @@ +{% macro license(SITEURL, LICENSE={'cc_name':'by', 'hosted':False, 'compact':True, 'brief':True}) %} + {% set cc_name = LICENSE['cc_name']|lower|trim|replace("cc-","") %} + {% if LICENSE['compact'] %} + {% set cc_size = "80x15" -%} + {% else %} + {% set cc_size = "88x31" -%} + {% endif %} + {% if not LICENSE['hosted'] %} + {% set cc_icon = [SITEURL|lower|trim, + "/theme/ico/cc/", + cc_name, + "/4.0/", + cc_size, + ".png" + ]|join("") + %} + {% else %} + {% set cc_icon = ["https://licensebuttons.net/l/", + cc_name, + "/4.0/", + cc_size, + ".png" + ]|join("") + %} + {% endif %} + {% set cc_title = ["Creative Commons Attribution 4.0 International", + cc_name|upper, + " License" + ]|join("") + %} + {% set cc_uri = ["http://creativecommons.org/licenses/", + cc_name, + "/4.0/" + ]|join("") + %} + {% if not LICENSE['brief'] %} + {% set cc_intro = "This work is licensed under a " %} + {% set cc_linktext = "Creative Commons CC_NAME 4.0 International License"|replace("CC_NAME", cc_name|upper, 1) %} + {% else %} + {% set cc_intro = "" %} + {% set cc_intro = "License " %} + {% set cc_linktext = "CC_NAME 4.0 "|replace("CC_NAME", cc_name|upper, 1) %} + {% endif %} + {% set license = [ + '<a class="license" rel="license" href="http://creativecommons.org/licenses/CC_NAME/4.0/">', + '<img alt="Creative Commons License" style="border-width:0" src="CC_ICON" /></a>'|replace("CC_ICON", cc_icon|trim), + cc_intro, + '<a class="license" rel="license" href="http://creativecommons.org/licenses/CC_NAME/4.0/">', + cc_linktext, + '</a>' + ] | join("") %} +{{ license|replace("CC_NAME", cc_name,2)|trim }} +{% endmacro %} |