kevinmarrec / nuxt-pwa-module

⚠️ DEPRECATED ⚠️ Zero config PWA solution for Nuxt 3
MIT License
338 stars 32 forks source link

Configuration of meta module #31

Closed BenjaminOddou closed 1 year ago

BenjaminOddou commented 1 year ago

Hello @kevinmarrec, as you suggested, I am creating a new issue to discuss about the configuration of the meta module.

I would like to input the following parameters into the meta option in the nuxt.config.ts file :

    htmlAttrs: {
      'xmlns:og': 'http://ogp.me/ns#' 
    },
    meta: [
      {
        name: 'keywords',
        content:
          'some, random, keywords'
      },
      {
        name: 'theme-color',
        content: '#FFFFFF',
        media: '(prefers-color-scheme: light)'
      },
      {
        name: 'theme-color',
        content: '#2A2A2A',
        media: '(prefers-color-scheme: dark)'
      },
      { name: 'apple-mobile-web-app-title', content: 'Short name' },
      { property: 'image', content: '/banner.jpg' },
      { name: 'msapplication-TileColor', content: '#2a2a2a' }

Thank you in advance for your help ! 🙏

kevinmarrec commented 1 year ago

Hey @BenjaminOddou , sorry for the late response, I thought I gave you one !

PWA meta option should be dedicated to PWA related head meta.

Therefore, for any global head meta you wand to add, I highly recommend you to use head option of Nuxt 3 configuration.

This will apply your meta configuration on all your pages.

Here's the documentation : https://v3.nuxtjs.org/api/configuration/nuxt.config#head 😉