I’ve also created SO question (https://stackoverflow.com/questions/56506055/setting-up-static-page-in-routes-yml), haven’t got any responses to so I figured I will post my question in here as well.
I’m trying to create a static page that would live in a sub-route (e.g. http://somepage.com/<root_route>/<sub_route>/
) and I can’t figure out what am I doing wrong with the routes.yaml, as I’m getting 404 page all the time.
Here’s my Routes.yml file
routes:
/test/route/:
template: applications
data: page.test-route
collections:
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
Couple of things to note, I did create a page with a slug test-route
and publish it and I did create the application.hbs file and put it in content/themes/casper
location. The application.hbs
content is as follows:
{{#page}}
PAGE
{{ content }}
{{/page}}
{{#post}}
POST
{{ content }}
{{/post}}
<div>something to display to indicate that routing is picking up the tempalte</div>
NOTE: I’ve added both #post
and #page
tags inside of this template to verify which variable is being populated with data.
Ghost version: 2.22.1