html.metaByEntries

  • Type: Record<string, Meta>
  • Default: undefined

Set different meta tags for different pages.

The usage is same as meta, and you can use the "entry name" as the key to set each page individually.

metaByEntries will overrides the value set in meta.

WARNING

Deprecated: This configuration is deprecated, please use the function usage of html.meta instead.

Example

export default {
  html: {
    meta: {
      description: 'ByteDance',
    },
    metaByEntries: {
      foo: {
        description: 'TikTok',
      },
    },
  },
};

After compiling, you can see that the meta of the page foo is:

<meta name="description" content="TikTok" />

The meta of other pages is:

<meta name="description" content="ByteDance" />
ON THIS PAGE