Skip to main content

Lektor Creative Commons

License: MIT Current version at PyPI Downloads per month on PyPI

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 a string 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'.
  • locale is an optional parameter that overrides the locale at function calling time.
  • 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(license, license_url, icon_path) render_cc_license('by-sa', size='normal') %}
  <a class="nav-item" rel="license" target="_blank" href="{{ license_url }}">
    <img alt="{{ license }}" style="border-width:0" src="{{ icon_path }}" />
  </a>
{% endcall %} 

There are more variables, you can check which with

{% call() render_cc_license('by-sa', size='normal') %}
  {{ kwargs }}
{% 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).

Release files for lektor-creative-commons 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lektor-creative-commons 0.6.0
File Size Uploaded
lektor-creative-commons-0.6.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lektor-creative-commons 0.6.0
File Interpreter ABI Platform
lektor_creative_commons-0.6.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 34.6 kB

Release files / lektor-creative-commons-0.6.0.tar.gz

Download URL lektor-creative-commons-0.6.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63522ecd2ed54d3d2a2ec3712fe3838f1b34a8bf5a4658b54c1614836ebac219
BLAKE2b-256 checksum
How to use checksums
9f7fc7aaeb28d640f3a946b297536c07aee801320ba5c1fb8fbc350559777100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release files / lektor_creative_commons-0.6.0-py2.py3-none-any.whl

Download URL lektor_creative_commons-0.6.0-py2.py3-none-any.whl
Size 29.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
87ecd567ed6be52618ced0d1413d5d97dc7cc34c536499f404017ccb3936cae8
BLAKE2b-256 checksum
How to use checksums
681b95a226f86ede465b2368545df8a1deca848ee443b87f843cae6315bf42d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3

3 release files

0.1.4

3 release files

0.1.3

3 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page