我正在一个研究站点上工作,对于每个主题,都会有一个阅读计划,其链接结构为:/plans/name-plan/{slug}/
。
将在/plans/plan-name/
中显示与所讨论的阅读平面相关的所有内容,而在/plans/
中,将使用其自己的模板(plans-name.hbs
)显示所有可用的阅读平面。
为此,我这样配置 routes.yaml :
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}/
正如在routes.yaml中一样,我已经定义了标记的永久链接在 redirects.json 中仅为/{slug}/
,我将与该计划相对应的标记定向到您自己的页面。 / p>
[
{
"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
}
]
但是,当我尝试访问计划主页(/planos/os-tesouros-salmo-119/
)时,唯一有效的计划是/plans/plan-name/
(是第一个创建的计划)所有其他计划都返回错误{ {1}}”。
生成的网址如下:
"ERR_TOO_MANY_REDIRECTS
...
开发环境:Windows Localhost
Ghost版本:2.25.6