Root relative path plugin for Lektor
Project description
Lektor root-relative-path plugin
This plugin returns root-relative-path list from top page to current page as below.
[(toppage_url, toppage_name), ...(parent_url, parent_name), (url, name)]
Installation
Add lektor-root-relative-path
to your project from the command line:
lektor plugins add lektor-root-relative-path
See the Lektor documentation for more instructions on installing plugins.
Configuration
Set these option in configs/root-relative-path.ini
:
navi_top_page_name
Optional. Name of top page inidicated in the navication. Default is 'Top Page'
navi_top_page_name = 'Top Page'
How to use
Insert the following line in the template (e.g. layout.html) which you would like to show navigation.
{% for i in this._path | root_relative_path_list %}
>><a href="{{i[0]}}">{{i[1]}}</a>
{% endfor %}
Then, navigation is shown as below in case the page 'blog/first-post/'
>>Top Page >>blog >>first-post
If you do not want to show current page in the navigation, modify template as below.
{% for i in this._path | root_relative_path_list %}
{% if not loop.last %}
>><a href="{{i[0]}}">{{i[1]}}</a>
{% endif %}
{% endfor %}
Then, navigation is shown as below.
>>Top Page >>blog
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
Hashes for lektor-root-relative-path-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a8aa615b57bd123d2b0c3ce4c7cf5a1fc079bbd7caaafe9c4094039b286589 |
|
MD5 | c9e027d5fa8f32af2b8d2ec53a9ea029 |
|
BLAKE2b-256 | e7a8ccb4a05a34848d3eb57f8c94c4764f58865be6466225b0231abf0ff9572e |