From ebf14fab1f6c07df6a0a680dc2d04f10526a911d Mon Sep 17 00:00:00 2001 From: Georg Sauthoff Date: Thu, 9 Feb 2017 17:56:03 +0100 Subject: [PATCH 1/2] remove < IE9 workaround those versions aren't even supported by MS anymore --- templates/base.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/templates/base.html b/templates/base.html index 9e6689d..a0f3693 100644 --- a/templates/base.html +++ b/templates/base.html @@ -54,11 +54,6 @@ {% endfor %} - - {% if CUSTOM_HTML_HEAD %} {% include "includes/" + CUSTOM_HTML_HEAD %} From 9bdf6fe3d13eb3af419d427c8c5eba1fd5debcbd Mon Sep 17 00:00:00 2001 From: Georg Sauthoff Date: Thu, 9 Feb 2017 18:05:43 +0100 Subject: [PATCH 2/2] add CDN_DICT and switch to a CDN with IPv6 support Improvements: - allow to easily override the used CDNs and still profit from SRI - new default: switch from bootstrap-cdn to the cdnjs.com CDN because bootstrap-cdn doesn't support IPv6 (cf. https://github.com/MaxCDN/bootstrap-cdn/issues/533) - switch from googleapis CDN to cdnjs.com as well - thus, by default one CDN is used for everything which can improve load times (think: connection re-use, pipelining) --- README.rst | 6 ++++++ templates/base.html | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index fb713e2..31e3f37 100644 --- a/README.rst +++ b/README.rst @@ -256,6 +256,12 @@ optional. files to be loaded. They will be referenced at the bottom of ``base.html``, after any default script files. +``CDN_DICT`` + Allows to override the CDNs for the used JS libraries. The dictionary + must include the keys bootstrap, jquery and awesome. It defaults to + the cdnjs.com public CDN because that CDN provides all the libraries, + is popular and supports IPv6. + ``ARCHIVES_URL`` URL of archives page. Default is ``archives.html``. If you're modifying ``ARCHIVES_SAVE_AS`` in your pelicanconf.py then you'll probably need to diff --git a/templates/base.html b/templates/base.html index a0f3693..2bff345 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,12 @@ + {% if not CDN_DICT %} + {% set CDN_DICT = { + 'bootstrap': 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap', + 'jquery' : 'https://cdnjs.cloudflare.com/ajax/libs/jquery', + 'awesome' : 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome', + } %} + {% endif %} @@ -33,12 +40,12 @@ {% else %} {% endif %} {% endif %} @@ -177,8 +184,8 @@ {% if not SKIP_DEFAULT_JS %} - - + {% endif %}