# 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](https://github.com/relikd/lektor-groupby-plugin) 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:
```ini
[block]
name = Text Element
button_label = [[paragraph]]
[fields.content]
label = Text
type = markdown
inlinetags = True
```
In your plugin config (`configs/inlinetags.ini`):
```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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/relikd/lektor-inlinetags-plugin",
"name": "lektor-inlinetags",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "lektor,plugin,blog,tags,tagging",
"author": "relikd",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/1b/06/2607eb935836d17c17bedd99102b2f4a7d44dca721c189103757324f2ac0/lektor-inlinetags-0.9.2.tar.gz",
"platform": null,
"description": "# lektor plugin: inlinetags\n\nThe inlinetags plugin allows you to use tags inside normal text / html / markdown elements.\nFor 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`.\n\nOf course, you can configure a different matching pattern, e.g., instead of the default `{{tag}}` use `$tag$` (`\\$(.{1,20}?)\\$`).\n\nThis plugin is based on the [lektor-groupby](https://github.com/relikd/lektor-groupby-plugin) plugin.\nAll configuration options from groupby can be used (including multiple attribute names).\nFurther, you can access the tags of a page with the filter `|vgroups(key1, key2, recursive=False)` where key is `0..N` attribute keys.\nIf no key is provided, all attributes will be returned \u2013 otherwise only matching attribute keys.\n\n\n### Example config file\n\nAdd a new `inlinetags = True` attribute to your model, e.g., a flow block:\n\n```ini\n[block]\nname = Text Element\nbutton_label = [[paragraph]]\n\n[fields.content]\nlabel = Text\ntype = markdown\ninlinetags = True\n```\n\nIn your plugin config (`configs/inlinetags.ini`):\n\n```ini\n[inlinetags]\nroot = /\nslug = tag/{key}/\ntemplate = tag-page.html\n\n[inlinetags.pattern]\nmatch = {{([^}]{1,32})}}\nreplace = <a class=\"tag\" href=\"{url}\">{name}</a>\n\n[inlinetags.fields]\ntitle = \"Tagged: \" ~ this.key_obj\n\n[inlinetags.key_map]\nC# = c-sharp\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Auto-detect and reference tags inside written text.",
"version": "0.9.2",
"split_keywords": [
"lektor",
"plugin",
"blog",
"tags",
"tagging"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "1c2b4fb0cdea584f0176de37d7ddc568",
"sha256": "db910fe527093a9f778e899d422a50ef8ac323f78ad8ae51c8fce2984a262e20"
},
"downloads": -1,
"filename": "lektor_inlinetags-0.9.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1c2b4fb0cdea584f0176de37d7ddc568",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4785,
"upload_time": "2022-12-20T02:15:57",
"upload_time_iso_8601": "2022-12-20T02:15:57.522641Z",
"url": "https://files.pythonhosted.org/packages/69/dd/cd69a17ef908060225e019b3a302baf0851621363c5627887637f49a298a/lektor_inlinetags-0.9.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "b5bd134bbee88d5cd8784032145e858d",
"sha256": "72fda54f1febd2298ca600893bcfabc33c1d9b5702b31e5ae81b7b3723b3702d"
},
"downloads": -1,
"filename": "lektor-inlinetags-0.9.2.tar.gz",
"has_sig": false,
"md5_digest": "b5bd134bbee88d5cd8784032145e858d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3757,
"upload_time": "2022-12-20T02:15:59",
"upload_time_iso_8601": "2022-12-20T02:15:59.098187Z",
"url": "https://files.pythonhosted.org/packages/1b/06/2607eb935836d17c17bedd99102b2f4a7d44dca721c189103757324f2ac0/lektor-inlinetags-0.9.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-20 02:15:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "relikd",
"github_project": "lektor-inlinetags-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "lektor-inlinetags"
}