Lektor plugin to add Creative Commons license to your pages
Project description
Lektor Creative Commons
Lektor plugin to add Creative Commons license to your pages
Usage
On your templates use:
<div class="license">{{ render_cc_license(type, size, template, caller) }}</div>
type
is astring
with the license type (e.g.:'by'
,'by-sa'
,'by-nc-sa'
).size
is an optional parameter with the size'normal'
or'compact'
. It defaults to'normal'
.template
is an optional parameter with the template'full'
,'image-only'
or'text-only'
. It defaults to'full'
.caller
is an optional parameter that you can pass an callable to mount your own template. This argument is usually omitted. See the example of how to use it with the Jinja call feature.
Examples
Simply rendering the license of your choice:
<div class="license">{{ render_cc_license('by-sa') }}</div>
Using Jinja2 call block to inject your own template:
{% call(type, version, locale, size, message, license, license_type) render_cc_license('by-sa') %}
<a class="nav-item" style="" rel="license" target="_blank" href="http://creativecommons.org/licenses/{{type}}/{{version}}/deed.{{locale}}">
<img class="" alt="Creative Commons {{type}}" style="border-width:0" src="https://i.creativecommons.org/l/{{type}}/{{version}}/{{size}}.png" />
</a>
{% endcall %}
Notice that using the call block it injects its content as caller
parameter to the render_cc_license
function that skips the need of choosing a template and renders your own.
Internationalization support
This plugin has support to internationalization, and changes it language based on .lektorproject
file.
The Current supported locales are:
- en
- pt_BR
- de
Any other locale will default to en
(English).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lektor-creative-commons-0.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | faf309f3206f47546b1a8a946ece20beb3b52bc459b5a45a2f8b80234a1fd13c |
|
MD5 | f136f2c165c543f31f2ddda409481c17 |
|
BLAKE2b-256 | e3b4fbdd3fbb72674f86248765f2a366fee2c1dee61acac8b527f95be6d63c97 |
Close
Hashes for lektor_creative_commons-0.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 820582b751d979d22bf4209beb09ca5665ecd6fd249879255f50a515da74f29b |
|
MD5 | 8bdd88c8bd536f7134d4d6d8f402cbbf |
|
BLAKE2b-256 | 393b9dd76d103b3c9fba13547ae132e42ab7bcf21c13030b63c4b8be86ec3b15 |