From 47c44b62822029ecaeff1f73b29f11e8c5226e63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 24 Oct 2017 18:35:42 +0200 Subject: [PATCH] Remove all workarounds related to the old schizophrenic URL handling. --- doc/pelican/theme.rst | 5 +++-- pelican-theme/templates/page.html | 4 ++-- site/pelicanconf.py | 20 +++++--------------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/doc/pelican/theme.rst b/doc/pelican/theme.rst index 7bcb7bd8..58f1b4d9 100644 --- a/doc/pelican/theme.rst +++ b/doc/pelican/theme.rst @@ -90,7 +90,8 @@ Value of :py:`SITENAME` is used in the :html:`` tag, separated with a of the website with pages is treated differently from the "blog" part with articles and there are two additional configuration options :py:`BLOGURL` and :py:`BLOGNAME` that control how various parts of the theme link to the blog and -how blog pages are named in the :html:`<title>` element. +how blog pages are named in the :html:`<title>` element. The :py:`BLOGURL` can +be either absolute or relative to :py:`SITEURL`. .. code:: py @@ -98,7 +99,7 @@ how blog pages are named in the :html:`<title>` element. SITEURL = '' BLOGNAME = 'Your Brand Blog' - BLOGURL = '/blog' + BLOGURL = 'blog/' Theme color :html:`<meta>` tag used by `CSS themes`_ can be specified with the :py:`THEME_COLOR` variable. If not set, no theme color :html:`<meta>` tag diff --git a/pelican-theme/templates/page.html b/pelican-theme/templates/page.html index f3dd08c8..691bfa1c 100644 --- a/pelican-theme/templates/page.html +++ b/pelican-theme/templates/page.html @@ -20,8 +20,8 @@ {% endif %} <meta property="og:title" content="{{ page.title }}" /> <meta name="twitter:title" content="{{ page.title }}" /> - <meta property="og:url" content="{% if page.url %}{{ page.url|format_siteurl }}{% else %}{{ SITEURL }}{% endif %}" /> - <meta name="twitter:url" content="{% if page.url %}{{ page.url|format_siteurl }}{% else %}{{ SITEURL }}{% endif %}" /> + <meta property="og:url" content="{{ page.url|format_siteurl }}" /> + <meta name="twitter:url" content="{{ page.url|format_siteurl }}" /> <meta property="og:description" content="{{ page.summary|striptags }}" /> <meta name="twitter:description" content="{{ page.summary|striptags }}" /> {% if page.cover %} diff --git a/site/pelicanconf.py b/site/pelicanconf.py index b01d4c1b..c7d0816f 100644 --- a/site/pelicanconf.py +++ b/site/pelicanconf.py @@ -32,7 +32,7 @@ SITEURL = '' BLOGNAME = 'm.css example articles' BLOGURL = 'examples/' -STATIC_URL = '/{path}' +STATIC_URL = '{path}' PATH = 'content' ARTICLE_PATHS = ['examples'] @@ -139,13 +139,13 @@ DIRECT_TEMPLATES = [] PAGE_URL = '/{slug}/' PAGE_SAVE_AS = '{slug}/index.html' -ARTICLE_URL = '/{category}/{slug}/' +ARTICLE_URL = '{category}/{slug}/' ARTICLE_SAVE_AS = '{category}/{slug}/index.html' -AUTHOR_URL = '/author/{slug}/' +AUTHOR_URL = 'author/{slug}/' AUTHOR_SAVE_AS = 'author/{slug}/index.html' -CATEGORY_URL = '/{slug}/' +CATEGORY_URL = '{slug}/' CATEGORY_SAVE_AS = '{slug}/index.html' -TAG_URL = '/tag/{slug}/' +TAG_URL = 'tag/{slug}/' TAG_SAVE_AS = 'tag/{slug}/index.html' AUTHORS_SAVE_AS = None # Not used @@ -154,13 +154,3 @@ TAGS_SAVE_AS = None # Not used SLUGIFY_SOURCE = 'basename' PATH_METADATA = '(?P<slug>.+).rst' - -# If https://github.com/getpelican/pelican/pull/2196 is not applied, all URLs -# would have / prepended twice, so removing it from the settings. -if True: - STATIC_URL = '{path}' - PAGE_URL = '{slug}/' - ARTICLE_URL = '{category}/{slug}/' - AUTHOR_URL = 'author/{slug}/' - CATEGORY_URL = '{slug}/' - TAG_URL = 'tag/{slug}/' -- 2.30.2