Syndication buttons and url

I use GRAV as a blog. No problem with the feed plugin and syndication buttons on the page with the list of articles. But the url of these buttons are bad for all other pages: page with a complete article, contact page, author’s page,… I think the problem is the variable {{ feed_url }}. I don’t find where this vaiable is created or assigned in the feed plugin.

Could you help to find this variable?

At this time, I modified the file “sidebar.html.twig” in the template, like this :

	{% if feed_url != 'blog' %}
		{% set feed_url = 'blog' %}
	{% endif %}
<div class="sidebar-content syndicate">
    <a class="button" href="{{ base_url_relative }}/{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
    <a class="button" href="{{ base_url_relative }}/{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a>
{% endif %}

I know this code is bad, but it works fine.

Have you updated to the very latest version of the plugins? and if you based your theme on Antimatter, had a look at latest version of that also?

A month or so back, I addressed this very problem. Basically I calculate a different base_url local variable in blog.html.twig and item.html.twig so that the links for these plugins is correct on each page.

BTW, your solution will work too. However, your just setting feed_url to blog every time, so not sure the need for the if()

Thx for your answer. I updated feed plugin to 1.3.1 and antimatter to 1.3.0. I think it is the last versions.

I will look in the 2 twig files why I have this problem. I will post here my results tomorrow :slight_smile:

I found the problem for the pages of blog. I forgot to update item.html.twig. Shame on me! ^^

But how can I address feed_urlfor the pages out of the blog (i.e. contact page)?

At this time I replaced:

        {% set feed_url = base_url~'/'~page.parent.slug %}
    {% endif  %}


        {% set feed_url = base_url~'/'~page.header.feed %}
    {% endif  %}

in the twig files out of the blog and where page.header.feed is addressed in the header of the md file.

Do you have a better way to do that, without a new line in the header of md files?

If you need to access from various pages you could set a site wide global variable in you site.yaml file and reference that. My changes were an attempt to make the theme not require a configure option like that, but if it works better for your use case there is nothing wrong with it.

OK, it seems to me it was the solution too, but I am not an expert with GRAV today. Thank you very much for your confirmation.