From 89dbba7a42273e664a9cc19a7dd28559b52bcadb Mon Sep 17 00:00:00 2001 From: Vitaly Potyarkin Date: Fri, 18 Oct 2019 18:08:37 +0300 Subject: [PATCH] Allow providing JavaScript assets for generated website Fixes #64, #65 Now users who wish to use Bootstrap dynamic elements (like dropdown menus) can enable JavaScript either by including required scripts into their static assets or by referencing their CDN URLs. By default Alchemy uses no JavaScript - that has not changed. --- README.md | 3 +++ alchemy/templates/base.html | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 6bc5787..eb8c8b8 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,9 @@ Visit the [Settings wiki](https://github.com/nairobilug/pelican-alchemy/wiki/Set - **RFG_FAVICONS**: Use a Favicon Generator package. - **THEME_CSS_OVERRIDES**: Sequence of stylesheet URLs to override CSS provided by theme. Both relative and absolute URLs are supported. +- **THEME_JS_OVERRIDES**: Sequence of JavaScript URLs to enable with this + theme. Alchemy uses no JS by default. Both relative and absolute URLs are + supported. Misc settings: diff --git a/alchemy/templates/base.html b/alchemy/templates/base.html index 681f92e..df01c38 100644 --- a/alchemy/templates/base.html +++ b/alchemy/templates/base.html @@ -59,6 +59,10 @@ {% include 'include/footer.html' %} + + {% for script in THEME_JS_OVERRIDES or () %} + + {% endfor %}