I’ve installed Source, the new Ghost theme, but since I’m using custom routes for my content, it’s not showing my posts on the homepage. Any ideas on how to fix this issue?
Paste your routes.yaml
routes:
collections:
/parabolas/:
permalink: /parabolas/{slug}/
template: tag
filter: primary_tag:parabolas
data: tag.parabolas
/talkgelion/:
permalink: /talkgelion/{slug}/
template: tag
filter: primary_tag:talkgelion
data: tag.talkgelion
/artigos/:
permalink: /artigos/{slug}/
template: tag
filter: primary_tag:artigos
data: tag.artigos
/o-que-fazer/:
permalink: /o-que-fazer/{slug}/
template: tag
filter: primary_tag:o-que-fazer
data: tag.o-que-fazer
/editorial/:
permalink: /editorial/{slug}/
template: tag
filter: primary_tag:editorial
data: tag.editorial
/gutenberg/:
permalink: /gutenberg/{slug}/
template: tag
filter: primary_tag:gutenberg
data: tag.gutenberg
/dropsgelion/:
permalink: /dropsgelion/{slug}/
template: tag
filter: primary_tag:dropsgelion
data: tag.dropsgelion
/teoleigo/:
permalink: /teoleigo/{slug}/
template: tag
filter: primary_tag:teoleigo
data: tag.teoleigo
/novas-de-cada-manha/:
permalink: /novas-de-cada-manha/{slug}/
template: tag
filter: primary_tag:novas-de-cada-manha
data: tag.novas-de-cada-manha
/biblia-365/:
permalink: /biblia-365/{slug}/
template: tag
filter: primary_tag:biblia-365
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /{slug}/
author: /autor/{slug}/
The source homepage has a LOT of options. Which version are you using? (Highlight / Magazine / Landing page?)
Ahha. The source theme uses a ‘home’ template, but you’ve got /: set to use the index template. I think that’s your issue?
I tried it with all the style options available (Highlight/Magazine/Landing page), but none of them worked. I even modified my routes.yaml, but it didn’t help either.
I’m having a similar issue with this theme, it will display a list or grid of posts depending on my choice in the settings, but none of the Style options do anything
Neither does the Show Featured Posts setting. And modifying the routes.yaml doesnt help for me either
For the folks having problems, can you please post whether you’re on Ghost Pro, or self-hosted, and if self-hosted, what version of Ghost you’re on? Source uses a bunch of new theme features, and I’m wondering if you’re trying to run it on a slightly older version of Ghost that doesn’t understand it…
I tried loading a variety of routes.yaml files. If you want the homepage layout on pages other than the homepage, you’re going to need to specify template: home. template: tag produces a fairly plain list of posts. Worth checking!
I’m using Ghost on my own Digital Ocean VPS right now, and my Ghost version is 5.66.0.
I even updated my routes file to make the theme use the home
template for the site’s main page, but still, I can’t get my posts to show up.
I tried this out on my local machine to see what’s going on. When I don’t edit the route file, the theme shows my posts just fine. But as soon as I start tinkering with collections in the routes.yaml, it stops showing them on the homepage.
I wasn’t able to replicate this on Ghost pro, as long as I set the template to home.
Actually, not even the Casper theme shows posts in this situation.
I’m currently using the Headline theme, but it only displays posts on the home page because I made some code modifications.
{{#get "tags" filter="slug:novas-de-cada-manha"}}
{{#foreach tags}}
{{> "topic-grid"}}
{{/foreach}}
{{/get}}
I attempted to replicate the same alterations to the Source theme, but it didn’t go as planned. I exclusively modified the Highlight style, which is the one I’m currently using. I used the same approach that had previously worked with other themes, but it just didn’t pan out this time.
{{#match feed "home"}}
{{#match @custom.header_style "Highlight"}}
{{#if @custom.show_featured_posts}}
{{#match posts.length ">=" 4}}
{{#get "posts" include="authors" limit="16" filter="slug:novas-de-cada-manha"}}
{{#foreach posts from="5" limit="12"}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
{{/match}}
{{else}}
{{#match posts.length ">=" 10}}
{{#get "posts" include="authors" limit="22" filter="slug:novas-de-cada-manha"}}
{{#foreach posts from="11" limit="12"}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
{{/match}}
{{/if}}
{{else match @custom.header_style "Magazine"}}
{{#match posts.length ">=" 7}}
{{#get "posts" include="authors" limit="19"}}
{{#foreach posts from="8" limit="12"}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
{{/match}}
{{else}}
{{#get "posts" include="authors" limit="12"}}
{{#foreach posts}}
{{> "post-card" lazyLoad=true}}
{{/foreach}}
{{/get}}
{{/match}}
{{/match}}
not sure if im seeing the same problem but when changing things in the edit theme ui the preview seems to get “stuck”. if i go down to edit the signup heading and subheadings the preview doesnt update with changes any longer, i have to save close then go back into it to see the changes. it also doesnt look like the text is selected in those boxes, but i can edit the text if i type. highlight and landing just show empty grids for me.
im running self hosted docker, which the 5.69.1 container isnt available yet so perhaps these are fixed there. im getting this in devtools when looking at the theme edit ui, not sure if thats related though.
Uncaught SyntaxError: redeclaration of const STORAGE_KEY
<anonymous> Ember
member-attribution.min.js:1:1
<anonymous> Ember
display of the different sections with highlight and landing seem resolved when i removed my filters in my routes. i still have some odd behavior when editing the settings in the theme edit ui though…
I have a similar issue with the Source landing page theme on Ghost(Pro) where the home page does not filter the posts anymore as defined in the routes.yaml. Additionally, neither on the separate collection (“newsletter”) neither any tag or author page do all posts load properly. Ghost cuts at 16 posts and does neither load continuously when scrolling nor displays a “See all” button.
routes.yaml:
routes:
collections:
/newsletter/:
permalink: /newsletter/{slug}/
template: index
filter: tag:hash-newsletter
/:
permalink: /{slug}/
template: home
filter: tag:-[hash-newsletter]
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
Interesting. I’ve got a client site with no routes.yaml that has the missing top section problem.