getgrav / getgrav/grav-plugin-feed

<link> using {{ base_url }} breaks when on home page with hidden slug

Open
#65 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
19
Forks
14
PR merge metrics
No merged PRs in 30d

Description

If we use this snippet, as suggested in the documentation:

But use it on the home page, while having it set so that the home page slug is hidden, then this ends up resulting in something like this:

Which is obviously not correct. I wonder if this is a solid alternative?

{% set rss_url = page.url(true) ~ page.template() ~ ".rss" %}

It works for my current use-case, but might break in other circumstances?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the documented {{ base_url }}.rss snippet on the home page with the slug hidden, then compare its output with the proposed page.url(true) and page.template() expression. Done means the generated RSS link is valid for this configuration without breaking other page contexts.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.