-
-
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
Theme API: Determine single vs multi-author blogs. #4908
Comments
Hey there @issmirnov, welcome! I have only skim read what you've written, but it sounds like you have an interesting proposition and I wanted to give you some quick feedback right away that will help to move this sort of feature request forward. One thing we're really big on, is ensuring that we clearly and fully understand a problem before designing the best possible solution that solves as many use cases as possible, and fits into the theme API. In this case, you've got a solution first - so I would recommend reworking this a bit to put the problem first, describing the use cases and all the wonderful things themes would be able to do if it was possible to determine whether a blog was single or multi-author. Then provide your potential solution at the end. That way, you open up discussion of the problem and use cases you may not have thought of, promote the design of the best possible solution and with all that the issue title ought to stay relevant. |
Hey @ErisDS, thanks for the welcome! I've updated my initial post with some screenshots and more structure. Take a look when you get a chance - I hope this edit will be closer to what you are looking for. I think there's definitely a lot of potential, both for theme designers and expanding Ghost's API in general. |
A related problem that I'm currently facing: needing access to authors (and tags, but that's another issue) in the global data scope. This seems so basic that I had even assumed it was currently possible (it's not, right? at least it's not documented where it seems most logical). Use case: a single-page-ish theme that uses ajax to display posts into a div with another div used to list posts that can be filtered by tag and author. Think: content section of the ghost admin area but as a theme, with different styling, and filtering. Of course there are hacks to get around this (javascript logic with hidden divs and such) but having a clean way to do it through the api would be incredible. Just a few cents from a Ghost theme dev. By the way, Ghost team and contributors, keep up the great work :) |
Also, regarding the API implementation, a simple |
Hey @Isaaki you are correct that there is no access to tags or authors in the global context. Ghost, by default, does the queries to fetch the exact data needed to render a particular context (a single post, a list of posts etc). Making all data always available just doesn't make sense. Therefore the future plan is to provide access to the API to allow theme authors to get any additional data they might want to display. You can read about those plans here: #4439 Back to the original issue of determining if the current blog is a a single author blog, the If it was decided this was desirable, then I'd propose keeping this to a simple flag However, at present, I'm not sure if the demand for this is enough to warrant providing an additional flag above and beyond what will eventually be possible by making a request to the API. I certainly think it's interesting, but as it's my job to consider things from all angles, I'm also wondering if there is any merit to having themes be clearly aimed at either single or multi-author blogs that would be lost by adding something like this. |
@ErisDS - what's the time table on the Ghost API? I haven't dived deep into the ghost engine yet, but if you direct me I would be happy to help with either getting that started and exporting an On a side note, do your stats tools allow you to get a distribution of single vs multi author blogs? I don't know the privacy implications, but perhaps if you could find a specific percentage for the two categories it might be easier to see how helpful (or not) this change would be. |
Hi @issmirnov, I raised this proposal in today's public dev meeting to get some feedback. There was a discussion (which you can read here), and the overwhelming consensus is that firstly there's not enough demand for a solution to this problem, and secondly that this isn't the right way to resolve it. In the near future the addition of the get helper will provide an alternative means to inspect information about authors within the theme rather than providing a specific flag. I've added a status update to #4439 which explains the status of the |
As per the comment below, I am editing this issue to have the problem foremost, and then potential solutions
Problem 1 - There is no way to determine if a blog is single or multi author, which can cause minimalist themes to have undue clutter
The way Ghost's defaults are set right now, the author object is a child of the post, and as such, on a single author blog the author's name can become an eye sore.
Example 1
As can be seen here, my home page has my name appear in the url, the main blog title, and every single post. I know for some people this is important, but for my personal needs I would prefer a way to only have my name appear a few times on a page.
Example 2
This problem is most obvious on the /author/author-name endpoint. We are on an author page, as such, it's obvious that all of the posts listed here will be by the author. However, the author's name is still multiplying in our eyes:
Proposed Solution 1
Add a
@blog.author.multiple
and@blog.author.single
tag, set according to the number of registered authors. This tag can be used in if/else clauses to modify the theme as needed.Use Case 1
I think it would help a lot if theme designers had a way of figuring out whether a blog is single user or multi user, and adjusting the theme accordingly. For the minimalist themes that I (and many others) use, the cleaner the page the better. Once there is a way to determine the nature of the blog, theme designers can add a conditional to their pages to exclude author links as desired.
Proposed Solution 2
As seen in example 2 above, the author page uses the same post loop partial as the main index. For a single user blog, the "by Author" suffix would not be present on any post links, so the problem is solved. However, on multi-author sites, the post loop on the front page should have an author link, while the author page should not.
Options:
Further Thoughts
Depending on where the maintainers of this project want to take it, it might be useful to expand the
@blog.author
data resource to allow iterating over various authors, getting a total count of them, and having their author links accessible from a global name space, rather than from within a post. This will allow the creation of an "About Us" page that can display all of the authors of the site, with their bio's, locations, etc.What do you all think?
The text was updated successfully, but these errors were encountered: