Put a landing page as home

Hello, I am not able to find this:

I have created a page, how to set up as homepage instead default home of any theme??

1 Like

On one of my sites, I created a custom homepage, and moved the usual layout to /blog. This necessitates a custom routes.yaml, and homepage template.

routes:
  /:
    data: page.home
    template: home
  /rss/:
    template: rss
    content_type: text/xml

collections:
  /blog/:
    permalink: /blog/{slug}/
    template: blog

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

I am not able to replicate =(

It crashes.

I just want this: I create a page mipage.com/landing

I want that home page (mypage.com) ere that created.

=(

Did you create a page with the slug ‘home’? And do you have a home.hbs file in your theme? If you didn’t, that’s probably why it isn’t working… (You could change the template to index.hbs instead if your theme doesn’t have a home.hbs.)

If you can provide more details on what’s not working (“it crashes” ?) we can try to help more!

2 Likes

I am new to Ghost and having a similar issue. I am currently using the Source theme and I am trying to create a static page in Ghost in my account that will be my home/landing page. I created that page and it is named home (_____.ghost.io/home/). I updated the routes to be:

routes:
/:
template: home
data: page.home

collections:
/posts/:
permalink: /posts/{slug}/
template: index

taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/

Is the route info wrong and/or am I missing something that has to also be updated in the home.hbs file?

Thanks!

Routes.yaml is very fussy about spacing. Can you paste yours back in using the </> button to make sure it doesn’t get mangled?

You probably do NOT want to use the home template for your static page - the home template is an index-type template and displays a bunch of posts, not the content of a page. You probably want the ‘page’ template instead.

Here’s a working example:

1 Like

Thank you so much, Cathy!!

2 Likes

Looking to tweak @Cathy_Sarisky 's elegant routes.yaml approach here.

Is there a simple code-injection solution for a landing page that removes all (or nearly all) nav and other links, etc., to create a simple, focused, Substack-like landing/signup page? The “no thanks” (or “Maybe later”/etc.) link would then go to the site’s main page.

If not, can a page template do this?

I think you could build something similar as a page, including a sign up card. You’d just need to use some code injection to hide the navigation

Gotcha, going to try and see how it does.

If I want a logged-in free or paid member to not be shown that page, and go to the regular home page, where would I test for that?

If you can edit the theme, make a custom .hbs file. Then use handlebars to check for logged in status. If it’s got to be code injection/html card, then check for /member/api/session returning a value, and redirect if it does, using javascript.