johannschopplich / kirby-serp-preview

🔍 Kirby Panel plugin for search engine result page previews
https://kirbyseo.com
MIT License
17 stars 2 forks source link

Custom title override #6

Closed grommasdietz closed 8 months ago

grommasdietz commented 8 months ago

The plugin currently constructs the title like currentContent[titleContentKey] || [panel.view.title, titleSeparator, siteTitle].join(" "). This is fine for most of the pages. However, When using SERP Preview on site or home, it’s may more common to just have the site title instead of the constructed one as a fallback. Should I provide a pull request for that?

Another or an additional approach could be a titleFallback to get the constructed title (e.g. from a page method) via KQL. It could be integrated like currentContent[titleContentKey] || titleFallback || [panel.view.title, titleSeparator, siteTitle].join(" "). I’m not sure if this would be logically consistent compared to the descriptionFallback, though.

johannschopplich commented 8 months ago

Good idea. I think we can unify the naming (while not introducing a breaking change and keeping backwards compatibility in the process). What about:

grommasdietz commented 8 months ago

Sounds good!

grommasdietz commented 8 months ago

Fixed by v0.5.2-beta.1, without having the site title instead of the constructed one as a fallback, yet.

johannschopplich commented 8 months ago

Please let a merged PR auto-close an issue. Otherwise, if a PR is closed without being merged, the issue should stay open. 🙂