I am working on a study site and for each subject there will be a reading plan with the link structure: /plans/name-plan/{slug}/
.
In /plans/plan-name/
all contents related to the reading plane in question will be displayed, while in /plans/
all available reading planes will be displayed using their own template (plans-name.hbs
).
For this I configure my routes.yaml like this:
routes:
/planos/: plans
/planos/os-tesouros-salmo-119/: plans-psalm-119
/planos/evangelho-de-joao/: plans-john
/planos/malaquias-hoje/: plans-malachi
collections:
/planos/malaquias-hoje/:
permalink: /planos/malaquias-hoje/{slug}/
filter: 'tag:malaquias-hoje'
template: plans-malachi
rss: false
/planos/os-tesouros-salmo-119/:
permalink: /planos/os-tesouros-salmo-119/{slug}/
filter: 'tag:os-tesouros-do-salmo-119'
template: plans-psalm-119
rss: false
/planos/evangelho-de-joao/:
permalink: /planos/evangelho-de-joao/{slug}/
filter: 'tag:evangelho-de-joao'
template: plans-john
rss: false
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /{slug}/
author: /autor/{slug}/
As in routes.yaml I have defined that the permalink of the tag will be only /{slug}/
in redirects.json I direct the tags corresponding to the plan to your own page
[
{
"from": "/os-tesouros-do-salmo-119/" ,
"to": "/planos/os-tesouros-salmo-119/",
"permanent": true
},
{
"from": "/evangelho-de-joao/" ,
"to": "/planos/evangelho-de-joao/",
"permanent": true
},
{
"from": "/malaquias-hoje/" ,
"to": "/planos/malaquias-hoje/",
"permanent": true
}
]
But the only plan that works correctly is /planos/os-tesouros-salmo-119/
(who was the first to be created) all the others when I try to access the main page of the plan (/plans/plan-name/
) returns the error "ERR_TOO_MANY_REDIRECTS"
.
And the generated url is like this:
http://localhost:2368/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/planos/evangelho-de-joao/
.
…
Development Environment localhost
Ghost Version: 2.25.6