Make it possible to define custom footer

Using the FOOTER_INCLUDE and EXTRA_TEMPLATES_PATHS settings it
is now possible to include a custom footer template instead of
the default "Powered by Pelican"!
This commit is contained in:
Mr. Senko 2016-01-17 17:34:48 +02:00
parent 52f805521e
commit 38272aac9e
3 changed files with 20 additions and 2 deletions

View File

@ -62,6 +62,17 @@ CSS_OVERRIDE = 'myblog.css'
Set ``DISABLE_CUSTOM_THEME_JAVASCRIPT`` to True if you want to disable
``js/clean-blog.min.js`` in case it affects forms and input fields.
### User defined footer
Define ``FOOTER_INCLUDE`` in ``pelicanconf.py`` to insert a custom footer text
instead the default "Powered by Pelican". The value is a template path. You also
need to define the ``EXTRA_TEMPLATES_PATHS`` setting. Example:
```python
FOOTER_INCLUDE = 'myfooter.html'
EXTRA_TEMPLATES_PATHS = [os.path.dirname(__file__)]
```
### Analytics
Accept many analytics:

View File

@ -146,8 +146,11 @@
{% endfor %}
{% endif %}
</ul>
<p class="copyright text-muted">Blog powered by <a href="http://getpelican.com">Pelican</a>,
which takes great advantage of <a href="http://python.org">Python</a>.</p>
{% if FOOTER_INCLUDE %}
{% include FOOTER_INCLUDE %}
{% else %}
{% include 'footer.html' %}
{% endif %}
</div>
</div>
</div>

4
templates/footer.html Normal file
View File

@ -0,0 +1,4 @@
<p class="copyright text-muted">
Blog powered by <a href="http://getpelican.com">Pelican</a>,
which takes great advantage of <a href="http://python.org">Python</a>.
</p>