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
Move postsPerPage to be a theme-level config option #8131
Comments
+1 for postsPerPage |
@JohnONolan I've got this implemented and as a result have a couple of bits of the spec that I need a little bit of clarity around, mostly to do with naming-things. Thing 1 - package.jsonIn package.json, I'm adding a new object like this:
Ideally I'd like to have some sort of top-level key to contain the theme's config here as that will keep my implementation minimal and easy, assuming we will come up with more things to put here, however I guess theme doesn't make that much sense, so perhaps it should be Secondly, I've called the setting ppp just cos that was fast to type. To be consistent with the rest of package.json, if we use multiple words we should camelCase. Any idea on what you preferred name for this config option is? Thing 2 - handlebarsBack in Ghost 0.7.3 we added both permalinks and the post per page setting available to the theme via the @blog global. E.g. Now that posts per page is no longer a global blog setting, should it be removed from here? I made a bunch of assumptions, assumed we'd want it to become part of a new @theme global and implemented it as Thing 3 - the defaultIt's currently set to 5, which is what it was before. Every blog that USED to have a setting with a different number will lose that configuration in Ghost 1.0. We could implement some really complex migration, but that seems totally unnecessary seeing as 1.0 is meant to have breaking changes. TLDR;
|
? |
Consistency clash: package.json uses camelCase, our theme API uses snake_case. I 100% agree that whatever we pick it makes sense to make them consistency. However, when it comes to which standard to break, I would much, much, much, much rather break general consistency with package.json than with the theme API. So can I raise you:
|
fine w/ me |
closes #8131 - Remove ppp from default-settings.json - Remove ppp from meta (unused?\!) - ✨ Basic concept of theme config - use theme config ppp setting - ✨ Make @config.posts_per_page helper available - rather than @blog.posts_per_page, we now have @config.posts_per_page - 🚨 Test updates - Adding TODO note
refs TryGhost/Ghost#8131, refs TryGhost/gscan#40 - we would like to show a recommendation for theme validation - this recommendation could look like "package.json `config.posts_per_page` is recommended. Default is 5`
refs TryGhost/Ghost#8131, refs TryGhost/gscan#40 - we would like to show a recommendation for theme validation - this recommendation could look like "package.json `config.posts_per_page` is recommended. Default is 5`
Ghost 1.0 is all about fixing things that annoy us or get in our way 😁
One of those things, is the "Posts per Page" setting in the admin panel. It tells a blog how many posts its allowed to output on a particular page. However, it makes little sense for this to be a global blog-level setting because this is presentation logic.
Presentation logic belongs in a theme, and ideally, it should be themes that control how much content appears on a page, in order to suit that themes particular layout. E.g. a 2 column theme might want an even number of pieces of content.
The version of this we want to ship for Ghost 1.0 involves adding a new concept of theme config via the package.json file.
Example:
As a next step, we're considering adding frontmatter to templates, so that this (and any other theme config we come up with) can be set on a template-level basis.
The text was updated successfully, but these errors were encountered: