Turn "Feed" button to a dropdown if multiple feeds are avaiable (fixes #72)

This commit is contained in:
daudix
2024-09-14 04:02:11 +03:00
parent a1946ae0b2
commit 7df26217f8
3 changed files with 25 additions and 2 deletions

View File

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add active state to footer's "Powered by" links.
- Add active state to footnotes' go back button.
- Add active state to slider thumb.
- Add Bahasa Melayu translation (#78).
- Add fading on top/bottom of the search results container.
- Add loading animation to "Load Comments" button.
- Add margin between comment author name and timestamp.
@ -26,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add zoom-on-hover to custom comment emojis.
- Return the scrollbar styling.
- Style mentions and hashtags in comments.
- Turn "Feed" button to a dropdown if multiple feeds are avaiable (#72).
### Changed

View File

@ -130,7 +130,7 @@
{%- set scripts = scripts | concat(with=["theme-switcher.js"]) %}
{%- endif %}
{%- if config.extra.nav.links.menu or config.languages | length > 0 or config.extra.nav.show_theme_switcher %}
{%- if config.extra.nav.links.menu or config.languages | length > 0 or config.extra.nav.show_theme_switcher or config.feed_filenames | length > 1 and config.extra.nav.show_feed %}
{%- set scripts = scripts | concat(with=["details.js"]) %}
{%- endif %}

View File

@ -105,7 +105,28 @@
</details>
</li>
{%- endif %}
{%- if config.generate_feeds and config.extra.nav.show_feed %}
{%- if config.feed_filenames | length > 1 and config.extra.nav.show_feed -%}
<li id="feed">
<details>
<summary class="circle" title="{{ macros_translate::translate(key='feed', default='Feed', language_strings=language_strings) }}">
<i class="icon"></i>
</summary>
<ul>
{%- for feed in config.feed_filenames %}
<li>
<a href="{{ get_url(path=feed, lang=lang) }}" rel="{{ rel_attributes }}">
{%- if feed == "rss.xml" -%}
RSS
{%- elif feed == "atom.xml" -%}
Atom
{%- endif -%}
</a>
</li>
{%- endfor -%}
</ul>
</details>
</li>
{%- elif config.generate_feeds and config.extra.nav.show_feed %}
<li id="feed">
<a class="circle" href="{{ get_url(path=config.feed_filenames[0], lang=lang) }}" title="{{ macros_translate::translate(key='feed', default='Feed', language_strings=language_strings) }}">
<i class="icon"></i>