lektor-inlinetags 0.9.2

Creator: rpa-with-ash

Last updated:

Add to Cart

Description:

lektorinlinetags 0.9.2

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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.