-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
This filter would allow you to do a reverse lookup based on the slug of the page you are looking for:
# custom Jinja2 filter
def get_by_slug(objs, slug):
for obj in objs:
if obj.slug == slug:
return obj
JINJA_FILTERS = {
"get_by_slug": get_by_slug,
}
https://siongui.github.io/2017/01/08/pelican-get-single-page-or-article-by-slug-metadata-in-theme/
Metadata
Metadata
Assignees
Labels
No labels