I have a english / french blog. I would like blog posts tagged with “fr” to be hidden from the main page and instead show up at /blog/fr.
I am trying with routes.yaml but am running into error when I try to upload the routes.yaml from Labs.
here is the modified routes.yaml:
routes:
collections:
/:
permalink: /{slug}/
filter: "-tag:fr"
template: index
/blog/fr/:
permalink: /blog/fr/{slug}/
filter: "tag:fr"
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
Error from ghost log:
[2025-01-21 15:27:49] ERROR "POST /blog/ghost/api/admin/settings/routes/yaml/" 500 7074ms
NAME: InternalServerError
MESSAGE: Could not load routes.yaml file.
level: critical
InternalServerError: Could not load routes.yaml file.
at /var/www/html/ghost/versions/5.105.0/core/server/services/route-settings/RouteSettings.js:129:35
at async Object.query (/var/www/html/ghost/versions/5.105.0/core/server/api/endpoints/settings.js:158:13)
at async getResponse (/var/www/html/ghost/versions/5.105.0/node_modules/@tryghost/api-framework/lib/pipeline.js:259:34)
at async ImplWrapper (/var/www/html/ghost/versions/5.105.0/node_modules/@tryghost/api-framework/lib/pipeline.js:264:30)
at async Http (/var/www/html/ghost/versions/5.105.0/node_modules/@tryghost/api-framework/lib/http.js:70:28)
I have tried 3-4 variants of this routes.yaml, it always breaks something, am I doing this the right way?