From e23400fe954b6bfac56f0bd8b3cbf6cc34fc406f Mon Sep 17 00:00:00 2001 From: Mark Drummond Date: Sat, 6 Nov 2021 08:50:46 -0400 Subject: [PATCH] Adds optional linking of sidebar images. --- pelican-bootstrap3/README.md | 15 ++++++---- .../templates/includes/sidebar/images.html | 30 +++++++++++-------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/pelican-bootstrap3/README.md b/pelican-bootstrap3/README.md index d99000405..bb83c649a 100644 --- a/pelican-bootstrap3/README.md +++ b/pelican-bootstrap3/README.md @@ -389,14 +389,19 @@ The footer will display a copyright message using the AUTHOR variable and the ye ### Sidebar Images -Include a series of images in the sidebar, with an optional header: +Include a series of _optionally linked_ images in the sidebar, with an optional +header. +``` SIDEBAR_IMAGES_HEADER = 'My Images' -SIDEBAR_IMAGES = ["/path/to/image1.png", "/path/to/image2.png"] - -Originally developed for including certification marks in your sidebar. E.g., +SIDEBAR_IMAGES = ( + ('/path/to/image1.png', 'https://link1'), + ('/path/to/image2.png', 'https://link2'), + ('/path/to/image2.png', ''), +) +``` -http://dmark.github.io +Originally developed for including certification marks in your sidebar. ### Translations diff --git a/pelican-bootstrap3/templates/includes/sidebar/images.html b/pelican-bootstrap3/templates/includes/sidebar/images.html index 2ca2e8ddd..ab2da1f79 100644 --- a/pelican-bootstrap3/templates/includes/sidebar/images.html +++ b/pelican-bootstrap3/templates/includes/sidebar/images.html @@ -1,16 +1,20 @@ {% if SIDEBAR_IMAGES %} - {% from 'includes/sidebar/macros.jinja' import title %} + {% from 'includes/sidebar/macros.jinja' import title %} - -
  • - {% if SIDEBAR_IMAGES_HEADER %} -

    {{ title(SIDEBAR_IMAGES_HEADER, DISABLE_SIDEBAR_TITLE_ICONS, icon='external-link-square') }}

    - {% endif %} - -
  • - + +
  • + {% if SIDEBAR_IMAGES_HEADER %} +

    {{ title(SIDEBAR_IMAGES_HEADER, DISABLE_SIDEBAR_TITLE_ICONS, icon='external-link-square') }}

    + {% endif %} + +
  • + {% endif %}