mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
add "output_file" Jinja context variable
"output_file" contains the name of the HTML file that pelican is currently rendering.
This commit is contained in:
parent
37f6190c69
commit
e045515b91
2 changed files with 4 additions and 0 deletions
|
|
@ -54,6 +54,9 @@ All of these settings will be available to all templates.
|
||||||
============= ===================================================
|
============= ===================================================
|
||||||
Variable Description
|
Variable Description
|
||||||
============= ===================================================
|
============= ===================================================
|
||||||
|
output_file The name of the file currently being generated. For
|
||||||
|
instance, when Pelican is rendering the homepage,
|
||||||
|
output_file will be "index.html".
|
||||||
articles The list of articles, ordered descending by date
|
articles The list of articles, ordered descending by date
|
||||||
All the elements are `Article` objects, so you can
|
All the elements are `Article` objects, so you can
|
||||||
access their attributes (e.g. title, summary, author
|
access their attributes (e.g. title, summary, author
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ class Writer(object):
|
||||||
context['localsiteurl'] = relative_path
|
context['localsiteurl'] = relative_path
|
||||||
localcontext['SITEURL'] = relative_path
|
localcontext['SITEURL'] = relative_path
|
||||||
|
|
||||||
|
localcontext['output_file'] = name
|
||||||
localcontext.update(kwargs)
|
localcontext.update(kwargs)
|
||||||
|
|
||||||
# check paginated
|
# check paginated
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue