druxt.js
druxt.js copied to clipboard
Better support for Metatags
Is your feature request related to a problem? Please describe. The DruxtRouter module has an unresolved @TODO for better Metatags support.
Describe the solution you'd like
- Investigate standard options for Metatags data in Drupal.
- Investigate decoupled options for Metatags data in Drupal.
- Investigate standard options for Metatags data in Nuxt.
Describe alternatives you've considered N/A
Additional context Drupal:
- https://www.drupal.org/project/metatag
- https://www.drupal.org/project/decoupled_kit (has Metatag support)
- https://www.drupal.org/project/jsonapi_hypermedia
Nuxt:
- https://nuxtjs.org/docs/2.x/features/meta-tags-seo
- https://github.com/AlekseyPleshkov/nuxt-social-meta
Druxt:
- https://github.com/druxt/druxt-router/blob/develop/src/components/DruxtRouter.vue#L75-L77
stack.lupus.digital handles metatags by grouping them into "backend" and "frontend" ones. The page API provides backend metatags which get added/removed when navigating changes, while the frontend metatags persist.
The metatags supported are simply fetched from metatag module, that has been fine so far.
Metatag not being in Drupal core is my biggest holdup on this.
I don't think that the Metatag module should be a dependency of the Drupal module, but I think that maybe some contrib modules like druxt_metatag could exist to handle dependency management.
But it should be easy enough for the Router module to consume the metatags endpoint if it's present.
The other question is how best to allow the customisation of the metatags.