From 68724e9682f91763104811ff72e092f07d9ad6b5 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 25 Jul 2017 09:00:41 -0700 Subject: [PATCH] Encourage use of https:// in SITEURL Refs #2183 #2186 --- docs/settings.rst | 8 +++++--- pelican/tools/pelican_quickstart.py | 2 +- pelican/tools/templates/publishconf.py.in | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 462f9d36..e5ce19f5 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -203,10 +203,12 @@ Basic settings .. data:: SITEURL - Base URL of your website. Not defined by default, so it is best to specify + Base URL of your web site. Not defined by default, so it is best to specify your SITEURL; if you do not, feeds will not be generated with - properly-formed URLs. You should include ``http://`` and your domain, with - no trailing slash at the end. Example: ``SITEURL = 'http://mydomain.com'`` + properly-formed URLs. If your site is available via HTTPS, this setting + should begin with ``https://`` — otherwise use ``http://``. Then append your + domain, with no trailing slash at the end. + Example: ``SITEURL = 'https://example.com'`` .. data:: STATIC_PATHS = ['images'] diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index ae0e8c9d..eb63ed1f 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -246,7 +246,7 @@ needed by Pelican. CONF['lang'] = ask('What will be the default language of this web site?', str_compat, args.lang or CONF['lang'], 2) - if ask('Do you want to specify a URL prefix? e.g., http://example.com ', + if ask('Do you want to specify a URL prefix? e.g., https://example.com ', answer=bool, default=True): CONF['siteurl'] = ask('What is your URL prefix? (see ' 'above example; no trailing slash)', diff --git a/pelican/tools/templates/publishconf.py.in b/pelican/tools/templates/publishconf.py.in index d1ed994d..473490a9 100755 --- a/pelican/tools/templates/publishconf.py.in +++ b/pelican/tools/templates/publishconf.py.in @@ -10,6 +10,7 @@ import sys sys.path.append(os.curdir) from pelicanconf import * +# If your site is available via HTTPS, make sure SITEURL begins with https:// SITEURL = '$siteurl' RELATIVE_URLS = False