kirby-seo icon indicating copy to clipboard operation
kirby-seo copied to clipboard

Split the title element from the seo/head snippet

Open FlorianBoe opened this issue 1 year ago • 1 comments
trafficstars

First of all, thank you for this wonderful plugin!

Would it be useful to add a way to split the title element from the seo/head snippet?

For performance reasons, it makes sense to structure the elements in the head so that the SEO and meta tags are at the end. However, the title element should be integrated as early as possible.

<head>
  <meta charset |http-equiv| viewport />
  <title></title>
  <!-- preconnect -->
  <script src="" async></script>
  <!-- CSS that includes @import -->
  <!-- Synchronous JS -->
  <!-- Synchronous CSS -->
  <!-- preloads -->
  <script src="" defer></script>
  <!-- prefetch / prerender -->
  <!-- Everything else ('SEO' meta tags, icons, Open Graph, etc.) -->
</head>

More on this, for example, in this talk or on capo.js.

FlorianBoe avatar Oct 08 '24 11:10 FlorianBoe

if anyone wants to implement this, I would make it a solution based on slots. if slots: true is passed to the snippet, it should output "priority" values, the slot, all other values. Priority could be specified here: https://github.com/tobimori/kirby-seo/blob/main/classes/Meta.php#L128 maybe?

tobimori avatar Oct 08 '24 16:10 tobimori