Hari Apologies, my response was rather harshly worded.
I've actually done a bit of a 180 in the past two hours as to SEO and Flarum. I've been trying to figure out some issues at the junction of the Blog, SEO, and Sitemap extensions that have left me somewhat concerned about extensibility of Flarum SEO. A few of the issues I discovered:
Routing
Blog implements alternative routes for some discussions. There's no way to change the canonical URL for those to point to the /blog
URL. Additionally, there isn't a good way for Sitemap to generate correct URLs to those discussions. This implies the need for a ModelUrl
helper, where URLs to a model's "Main Page" would be generated from the model instance, not parameters, and which could be overriden by extensions.
Content/Document
The content/document system is currently a mess, there's no other way of putting it. The way it works right now is as follows:
Content
functions mutate a document
object, changing some (fixed) properties.
- The document class assembles the final versions of those properties into HTML fragments, which it passes to the Blade template
Among other issues, there's no way to register a globally-applicable "Content" handler which will run after the content used for a single route. Flarum Blog's BlogArticle handler registers a lot of metadata, but none of it is read by Flarum SEO's global content, because that runs first. So none of that has any effect.
For this particular one, I'm not sure of what a good solution is, but I feel like it's some combination of the following:
- Allow registering globally-applicable content that runs after all other content
- Integrate a lot of the SEO helper functions into core directly. Revamp the document and content system to be higher-level and more aware of SEO requirements, because I don't see a clean way for the current low-level approach to support extensibility
General SEO Thoughts
@Franz's point makes sense (as usual): we should either do it right, or not do it at all. I'm not sure that I've entirely come to the conclusion of folding Flarum SEO into core, but I'm a lot closer to there than before. Perhaps the "status check" parts and some parts (robots.txt) could stay into that extension, and the "extending the page with SEO tags" should go into core.