From 38272aac9e36315befa6001c2789835d5775735f Mon Sep 17 00:00:00 2001 From: "Mr. Senko" Date: Sun, 17 Jan 2016 17:34:48 +0200 Subject: [PATCH] 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"! --- README.md | 11 +++++++++++ templates/base.html | 7 +++++-- templates/footer.html | 4 ++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 templates/footer.html diff --git a/README.md b/README.md index f43c21c..e02ecc5 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/templates/base.html b/templates/base.html index f4e302f..5f02427 100644 --- a/templates/base.html +++ b/templates/base.html @@ -146,8 +146,11 @@ {% endfor %} {% endif %} - + {% if FOOTER_INCLUDE %} + {% include FOOTER_INCLUDE %} + {% else %} + {% include 'footer.html' %} + {% endif %} diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..b0a7065 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,4 @@ +