lektor plugin: inlinetags
The inlinetags plugin allows you to use tags inside normal text / html / markdown elements.
For example, you can write This is my {{Lektor}} powered website and it will automatically replace the tag with a link to the actual page: This is my <a href="/tag/lektor/">Lektor</a> powered website.
Of course, you can configure a different matching pattern, e.g., instead of the default {{tag}} use $tag$ (\$(.{1,20}?)\$).
This plugin is based on the lektor-groupby plugin.
All configuration options from groupby can be used (including multiple attribute names).
Further, you can access the tags of a page with the filter |vgroups(key1, key2, recursive=False) where key is 0..N attribute keys.
If no key is provided, all attributes will be returned – otherwise only matching attribute keys.
Example config file
Add a new inlinetags = True attribute to your model, e.g., a flow block:
[block]
name = Text Element
button_label = [[paragraph]]
[fields.content]
label = Text
type = markdown
inlinetags = True
In your plugin config (configs/inlinetags.ini):
[inlinetags]
root = /
slug = tag/{key}/
template = tag-page.html
[inlinetags.pattern]
match = {{([^}]{1,32})}}
replace = <a class="tag" href="{url}">{name}</a>
[inlinetags.fields]
title = "Tagged: " ~ this.key_obj
[inlinetags.key_map]
C# = c-sharp
Metadata
Release files for lektor-inlinetags 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lektor-inlinetags-0.9.2.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lektor_inlinetags-0.9.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 kB
Security for lektor-inlinetags 0.9.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.