Add support for MENUITEMS and DISPLAY_PAGES_ON_MENU
With this commit, `.sidebar-nav` is renamed to `.sidebar-social`. Then a
new class `.sidebar-nav` is created and used for the menu items. This
change more or less restores `.sidebar-nav` originally was in the
`hyde.css` file.
Since `DISPLAY_PAGES_ON_MENU` defaults to `True`, this commit will
modify the appearance of your site. To go back to the previous behavior,
add this to your pelicanconf.py:
DISPLAY_PAGES_ON_MENU = False
References:
- <https://docs.getpelican.com/en/stable/settings.html#basic-settings>
- <https://docs.getpelican.com/en/stable/settings.html#MENUITEMS>
This commit is contained in:
@@ -17,10 +17,13 @@ List of Pelican's settings that are supported by this theme. Refer to the
|
||||
for more details.
|
||||
|
||||
- `FEED_*` and `*_FEED_*`
|
||||
- `DISPLAY_PAGES_ON_MENU`
|
||||
- `DISQUS_SITENAME`
|
||||
- `GOOGLE_ANALYTICS`
|
||||
- `GA_COOKIE_DOMAIN`
|
||||
- `SITESUBTITLE`
|
||||
- `MENUITEMS`
|
||||
- `SOCIAL`
|
||||
|
||||
Additional settings:
|
||||
|
||||
|
||||
@@ -98,6 +98,13 @@ html {
|
||||
/* Sidebar nav */
|
||||
.sidebar-nav {
|
||||
margin-bottom: 1rem;
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
.sidebar-social {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.sidebar-nav-item {
|
||||
display: block;
|
||||
|
||||
+15
-1
@@ -12,7 +12,21 @@
|
||||
<p class="lead">{{ BIO }} </p>
|
||||
<p></p>
|
||||
</div>
|
||||
<nav class="sidebar-nav">
|
||||
{% if MENUITEMS or DISPLAY_PAGES_ON_MENU %}
|
||||
<ul class="sidebar-nav">
|
||||
{% if MENUITEMS %}
|
||||
{% for title, url in MENUITEMS %}
|
||||
<li><a href="{{ SITEURL }}/{{ url }}">{{ title }}</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if DISPLAY_PAGES_ON_MENU %}
|
||||
{% for p in pages %}
|
||||
<li><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<nav class="sidebar-social">
|
||||
{% for name, link in SOCIAL %}
|
||||
{% if name == 'email' %}
|
||||
<a class="sidebar-nav-item" href="mailto:{{ link }}">
|
||||
|
||||
Reference in New Issue
Block a user