vite-plugin-pages icon indicating copy to clipboard operation
vite-plugin-pages copied to clipboard

Add dynamic meta to dynamic routes

Open SelfhostedPro opened this issue 2 years ago • 0 comments

Description

If there's not already a way that's undocumented, it's not possible to set dynamic metadata on dynamic routes. It would be really nice to be able to add this info so that it can easily be referenced.

Suggested solution

If you have a route with params: [name].vue it would be great to be able to sub it in the route block. ie:

<route lang="yaml">
    meta:
        title: {{ name }}
        layout: default
</route>

or

<route lang="yaml">
    meta:
        title: $name
        layout: default
</route>

Alternative

No response

Additional context

`

Validations

  • [X] Follow the Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

SelfhostedPro avatar May 17 '23 23:05 SelfhostedPro