From d71e17febbb533f72ecacf68f832cbf467baa2ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 26 Oct 2017 22:25:27 +0200 Subject: [PATCH] theme: standardize and document slug for blog-related pages. --- doc/pelican/theme.rst | 6 ++++-- pelican-theme/templates/base_blog.html | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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 %} -- 2.30.2