Addresses #73 in the existing 'basic' example, by adding a site-wide baseUrl configuration value and appending the page's relative path to that in the default Head component.
I wasn't sure of the most appropriate way to provide the baseUrl constant.
I added it as a config value per https://vike.dev/pageContext, which seemed most appropriate, but then I started to have some doubts when I had to add the type to ConfigVikeVue, which seems like a bit of a 'smell'. If another mechanism is more appropriate please let me know. From my perspective it could just as reasonably be a vite .env value (e.g. import.meta.env.BASE_URL), or an exported constant, or even just a project-wide const imported by HeadDefault.vue.
Thanks - I merged your requested changes into the branch on this PR, and and confirmed that corresponding changes to my actual site work great as well.
Addresses #73 in the existing 'basic' example, by adding a site-wide baseUrl configuration value and appending the page's relative path to that in the default
Head
component.I wasn't sure of the most appropriate way to provide the
baseUrl
constant.I added it as a config value per https://vike.dev/pageContext, which seemed most appropriate, but then I started to have some doubts when I had to add the type to
ConfigVikeVue
, which seems like a bit of a 'smell'. If another mechanism is more appropriate please let me know. From my perspective it could just as reasonably be a vite .env value (e.g.import.meta.env.BASE_URL
), or an exported constant, or even just a project-wide const imported by HeadDefault.vue.-Tim