-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Frontend controller refactor #5192
Comments
@ErisDS I'll take a crack at this this weekend and see what I can come up with :) |
@ErisDS before I rewrite this, I have a question about channels. I read through the documentation on the wiki, and I saw that the author and tag behavior is/should be identical with regards to templating. However, the current controller allows specific tag templates, but not specific author templates. My question is, which one is correct? Personally, I would vote for both tags and authors being able to have specific templates. |
Definitely both, I thought that was already implemented!!! |
@ErisDS I created a bit of test documentation for the channel options being passed in here: Can you take a look at it and let me know if I'm on the right track? |
closes TryGhost#5192 - combines homepage, author, tag routes into one function (with different hash params) - provides some abstraction for channels
closes TryGhost#5192 - combines homepage, author, tag routes into one function (with different hash params) - provides some abstraction for channels
closes TryGhost#5192 - combines homepage, author, tag routes into one function (with different hash params) - provides some abstraction for channels
It's always hard to spec a refactoring issue, as it's always more art than science ;)
This refactor is one of the key parts of the work we need to do to refactor the entire frontend of Ghost (that is the blog rendering part) so that we can make Channels a reality.
The frontend controller is currently made up of 3 functions that are almost identical for each of the index, tag and author routes.
This hardcoded, duplicated logic makes it hard to extend Ghost or make these routes behave more dynamically. We need to abstract this logic out a bit to make it easier to work with.
The aim of this issue is to refactor these three functions into a single rendering function and a set of configuration properties for each route/channel. It can all continue to live in the same file, but we should end up with a more abstracted controller, ready to move this into a separate system.
The document on channels explains the kind of configuration properties we expect to have for each route/channel. It will all remain hardcoded at the moment - it won't yet become configurable or extensible - that's another step.
There is one goal for this issue, of deduplicating logic and determining exactly what bits of information, like the url, or the number of postsPerPage, we need to customise for each one to make it work exactly as it does now.
The text was updated successfully, but these errors were encountered: