chiark / gitweb /
Remove all workarounds related to the old schizophrenic URL handling.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 16:35:42 +0000 (18:35 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 16:49:34 +0000 (18:49 +0200)
doc/pelican/theme.rst
pelican-theme/templates/page.html
site/pelicanconf.py

index 7bcb7bd8436b6f82b37cf90a0696df75ff6c9dcc..58f1b4d934f61e22caae9de452920b9140a75449 100644 (file)
@@ -90,7 +90,8 @@ Value of :py:`SITENAME` is used in the :html:`<title>` 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
index f3dd08c881ba72b3f5ffb11bdd7ddf586867c05e..691bfa1cd22719367e8c2c08e1a00f173d512c49 100644 (file)
@@ -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 %}
index b01d4c1b1af87aa075c54494742c22c52d0089aa..c7d0816f83a514f751ed66947016e43eed74f371 100644 (file)
@@ -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}/'