mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1767 from ingwinlu/rm_PAGES
Remove PAGES; use pages instead
This commit is contained in:
commit
ed71ad0d3a
5 changed files with 17 additions and 3 deletions
13
docs/faq.rst
13
docs/faq.rst
|
|
@ -250,3 +250,16 @@ moved out of the pelican core and into a separate `plugin
|
||||||
<https://github.com/getpelican/pelican-plugins/tree/master/tag_cloud>`_.
|
<https://github.com/getpelican/pelican-plugins/tree/master/tag_cloud>`_.
|
||||||
See the :ref:`plugins` documentation further information about the
|
See the :ref:`plugins` documentation further information about the
|
||||||
Pelican plugin system.
|
Pelican plugin system.
|
||||||
|
|
||||||
|
Since I upgraded Pelican my Pages are no longer rendered
|
||||||
|
========================================================
|
||||||
|
Pages were available to Themes as lowercase ``pages`` and uppercase
|
||||||
|
``PAGES``. To bring this inline with the :ref:`templates-variables` section,
|
||||||
|
``PAGES`` has been removed. This is quickly resolved by updating your theme
|
||||||
|
to iterate over ``pages`` instead of ``PAGES``. Just replace::
|
||||||
|
|
||||||
|
{% for pg in PAGES %}
|
||||||
|
|
||||||
|
with something like::
|
||||||
|
|
||||||
|
{% for pg in pages %}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ To make your own theme, you must follow the following structure::
|
||||||
if it helps you keep things organized while creating your theme.
|
if it helps you keep things organized while creating your theme.
|
||||||
|
|
||||||
|
|
||||||
|
.. _templates-variables:
|
||||||
|
|
||||||
Templates and variables
|
Templates and variables
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -644,7 +644,6 @@ class PagesGenerator(CachingGenerator):
|
||||||
process_translations(hidden_pages))
|
process_translations(hidden_pages))
|
||||||
|
|
||||||
self._update_context(('pages', 'hidden_pages'))
|
self._update_context(('pages', 'hidden_pages'))
|
||||||
self.context['PAGES'] = self.pages
|
|
||||||
|
|
||||||
self.save_cache()
|
self.save_cache()
|
||||||
self.readers.save_cache()
|
self.readers.save_cache()
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<li><a href="{{ link }}">{{ title }}</a></li>
|
<li><a href="{{ link }}">{{ title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DISPLAY_PAGES_ON_MENU -%}
|
{% if DISPLAY_PAGES_ON_MENU -%}
|
||||||
{% for pg in PAGES %}
|
{% for pg in pages %}
|
||||||
<li{% if pg == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ pg.url }}">{{ pg.title }}</a></li>
|
<li{% if pg == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ pg.url }}">{{ pg.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
<li><a href="{{ link }}">{{ title }}</a></li>
|
<li><a href="{{ link }}">{{ title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if DISPLAY_PAGES_ON_MENU %}
|
{% if DISPLAY_PAGES_ON_MENU %}
|
||||||
{% for p in PAGES %}
|
{% for p in pages %}
|
||||||
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue