Skip to content

Commit

Permalink
Add toggle option for RSS feed visibility (mmistakes#2787)
Browse files Browse the repository at this point in the history
* add a "hide" value in config for atom

* Update footer to use param

* update header to use param

* Update docs to note configuration

* undo formatting

* use unless syntax

* unless syntax and indentation

* indentation
  • Loading branch information
SeanKilleen authored and chukycheese committed Sep 18, 2023
1 parent 0f0797c commit 7ba0d99
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ reCaptcha:
secret :
atom_feed:
path : # blank (default) uses feed.xml
hide : # true, false (default)
search : # true, false (default)
search_full_content : # true, false (default)
search_provider : # lunr (default), algolia, google
Expand Down
4 changes: 3 additions & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
{% endfor %}
{% endif %}

<li><a href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].feed_label | default: "Feed" }}</a></li>
{% unless site.atom_feed.hide %}
<li><a href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].feed_label | default: "Feed" }}</a></li>
{% endunless %}
</ul>
</div>

Expand Down
6 changes: 4 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

{% include seo.html %}

<link href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">
{% unless site.atom_feed.hide %}
<link href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">
{% endunless %}

<!-- https://t.co/dKP3o1e -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down Expand Up @@ -34,4 +36,4 @@
{% for script in site.head_scripts %}
<script src="{{ script | relative_url }}"></script>
{% endfor %}
{% endif %}
{% endif %}
9 changes: 9 additions & 0 deletions docs/_docs/05-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,15 @@ atom_feed:
**Note:** By default the site feed is linked in two locations: inside the [`<head>` element](https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/head.html) and at the bottom of every page in the [site footer](https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/footer.html).
{: .notice--info}

### Disable Feed Icons

By default the theme links to `feed.xml` generated in the root of your site by the **jekyll-feed** plugin. To remove the RSS icon in the header and footer, update `atom_feed` in `_config.yml` like so:

```yaml
atom_feed:
hide: true
```

### Site search

To enable site-wide search add `search: true` to your `_config.yml`.
Expand Down

0 comments on commit 7ba0d99

Please sign in to comment.