Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added static front page support #4946

Closed
wants to merge 1 commit into from

Conversation

chuntley
Copy link

Very simple 2 line change to the frontend router. This checks if a home.hbs file is present, and if so, will use that as the static front page. The index.hbs file continues to function as a normal blog page.

The /page/1 redirect to / has been removed. When using a static front page, the path /page/1 is used to access the blog.

@chuntley
Copy link
Author

The redirect from /page/1 to / fails testing, as expected. Let me know.

@ErisDS
Copy link
Member

ErisDS commented Mar 17, 2015

Hi @chuntley, sorry for taking so long to respond to you here. This PR breaks the expectations around the home.hbs template, which is intended to allow you to style the first page of your blog completely differently to any other page.

Ghost currently doesn't support allowing for a static homepage as this is considered to be a CMS rather than a blog behaviour. It's been suggested over on our wishlist and if it gains significant support, we'll consider adding an intuitve way to do it. However, at present I still believe it's the kind of feature which belongs in an app rather than in core.

@ErisDS ErisDS closed this Mar 17, 2015
@chuntley
Copy link
Author

I do not follow that logic as you already have static page support. A static front page simply moves a static page to the home position. Our use case is to introduce our blog, authors, mission, and show a brief list of recent posts with a link to the blog. Without static front page support, the brief list of recent posts would not be included in our full blog view.

I'm going to keep my fork updated as we update our sites. Hopefully you guys reconsider, and if you have ideas on updates to my PR let me know.

@novaugust
Copy link
Contributor

@chuntley What you're describing sounds like something that's already possible with home.hbs. I also think "static front page" is getting used to mean different things here. At Ghost, "static page" means the content is entirely held within a post object, and no other data is given to the theme to render (other posts, etc).

@chuntley
Copy link
Author

@novaugust, the issue with home.hbs is that it will always display the latest posts (as blog page 1). If you have an introduction to your blog as the home page (which I tend to do, rather than throwing people straight into it), a link to your blog from there will throw you on blog page 2.

I think you are right about the terminology getting a little mixed up here, but hopefully that helps clear things up.

@novaugust
Copy link
Contributor

I think I've got you... you want both a homepage and a /page/1 page

On Tue, Mar 17, 2015 at 1:14 PM, chuntley notifications@github.com wrote:

@novaugust https://github.com/novaugust, the issue with home.hbs is
that it will always display the latest posts (as blog page 1). If you have
an introduction to your blog as the home page (which I tend to do, rather
than throwing people straight into it), a link to your blog from there will
throw you on blog page 2.

I think you are right about the terminology getting a little mixed up
here, but hopefully that helps clear things up.


Reply to this email directly or view it on GitHub
#4946 (comment).

@chuntley
Copy link
Author

@novaugust, exactly.

@ErisDS
Copy link
Member

ErisDS commented Mar 19, 2015

@chuntley I understand what you're trying to achieve here, however the approach proposed in this PR reappropriates the home.hbs template such that it switches on this behaviour, which to me is a very hard to understand side effect, not to mention that it would affect anyone already using the feature. Additionally, I don't think that /page/1/ would satisfy most proponents of this use case as a location for the first page of their blog.

As I see it, the idea here is twofold: 1) the first page of the blog listing should live at a configurable location, and 2) the home page should be used for something else which may or may not include showing blog posts.

This idea is very commonly articulated as using a static page as the home page, which comes from a similar feature available in WordPress. I realise that's not what you want to do, but the main parts are the same - move the first page of the blog listings, and do something else at /. This is also what was requested on the wishlist.

As per the guiding principles explained here, this isn't something we've ever felt warranted a specific option in Ghost core. That doesn't mean that it should be impossible, rather that it is a level of customisation that would require an app or similar to achieve.

Moving forward, the introduction of the get helper will give you a somewhat hacky way to achieve roughly what you're after via your theme. You'll be able to use the home.hbs as you want, and a combination of a static page, custom page template & use of the {{#get}} helper will get you your new first blog page. Further into the future, it'll become much easier with apps.

@chuntley
Copy link
Author

@ErisDS: Thank you for the response. Once apps feature gets closer to release I'll put that together!

@ripixel
Copy link

ripixel commented May 7, 2015

@chuntley Fantastic, exactly what I was looking for. Simple, works, beautiful. Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants