From: Vladimír Vondruš Date: Thu, 26 Oct 2017 20:25:27 +0000 (+0200) Subject: theme: standardize and document slug for blog-related pages. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=d71e17febbb533f72ecacf68f832cbf467baa2ed;p=blog.git theme: standardize and document slug for blog-related pages. --- diff --git a/doc/pelican/theme.rst b/doc/pelican/theme.rst index 58f1b4d9..7fd9c2e6 100644 --- a/doc/pelican/theme.rst +++ b/doc/pelican/theme.rst @@ -128,7 +128,9 @@ link title, second the URL, third page slug of the corresponding page (used to highlight currently active menu item) and fourth is a list of sub-menu items (which are 3-tuples --- link title, URL and page slug). Providing an empty slug will make the menu item never highlighted; providing an empty list of sub-menu -items will not add any submenu. +items will not add any submenu. All blog-related pages (articles, article +listing, authors, tags, categories etc.) have the slug set to a special value +``[blog]``. Example configuration, matching example markup from the `CSS page layout <{filename}/css/page-layout.rst#sub-menus-in-the-navbar>`__ @@ -142,7 +144,7 @@ documentation: ('Showcase', '/showcase/', 'showcase', []), ('Download', '/download/', 'download', [])] - LINKS_NAVBAR2 = [('Blog', '/blog/', 'blog', [ + LINKS_NAVBAR2 = [('Blog', '/blog/', '[blog]', [ ('News', '/blog/news/', ''), ('Archive', '/blog/archive/', '')]), ('Contact', '/contact/', 'contact', [])] diff --git a/pelican-theme/templates/base_blog.html b/pelican-theme/templates/base_blog.html index 6e9dbb8c..22cc3474 100644 --- a/pelican-theme/templates/base_blog.html +++ b/pelican-theme/templates/base_blog.html @@ -1,4 +1,4 @@ -{% set page_slug = 'blog' %} +{% set page_slug = '[blog]' %} {% extends 'base.html' %} {% block title %}{{ BLOGNAME }}{% endblock %}