Skip to content

Commit

Permalink
Merge pull request #716 from dmark/adds-links-to-sidebar-images
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer authored Nov 12, 2023
2 parents 0ef81d4 + e23400f commit d01c114
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
15 changes: 10 additions & 5 deletions pelican-bootstrap3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 17 additions & 13 deletions pelican-bootstrap3/templates/includes/sidebar/images.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{% if SIDEBAR_IMAGES %}
{% from 'includes/sidebar/macros.jinja' import title %}
{% from 'includes/sidebar/macros.jinja' import title %}

<!-- Sidebar/Images -->
<li class="list-group-item">
{% if SIDEBAR_IMAGES_HEADER %}
<h4>{{ title(SIDEBAR_IMAGES_HEADER, DISABLE_SIDEBAR_TITLE_ICONS, icon='external-link-square') }}</h4>
{% endif %}
<ul class="list-group" id="links">
{% for image in SIDEBAR_IMAGES %}
<img width="100%" class="img-thumbnail" src="{{ image }}"/>
{% endfor %}
</ul>
</li>
<!-- End Sidebar/Images -->
<!-- Sidebar/Images -->
<li class="list-group-item">
{% if SIDEBAR_IMAGES_HEADER %}
<h4>{{ title(SIDEBAR_IMAGES_HEADER, DISABLE_SIDEBAR_TITLE_ICONS, icon='external-link-square') }}</h4>
{% endif %}
<ul class="list-group" id="images">
{% for i in SIDEBAR_IMAGES %}
{% if i[1] %}
<a href="{{ i[1] }}" target="_blank"><img width="100%" class="img-thumbnail" src="{{ i[0] }}"/></a>
{% else %}
<img width="100%" class="img-thumbnail" src="{{ i[0] }}"/>
{% endif %}
{% endfor %}
</ul>
</li>
<!-- End Sidebar/Images -->
{% endif %}

0 comments on commit d01c114

Please sign in to comment.