LoginSignup
0
0

More than 3 years have passed since last update.

Nuxt.jsでデフォルトで使うメタ情報を設定する

Posted at

設定ファイルのhead欄に変更を加える

nuxt.config.js
export default {
  head: {
    title: 'test',
    htmlAttrs: { lang: 'ja' },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'test' },
      { hid: 'og:title', property: 'og:title', content: 'test' },
      { hid: 'og:description', property: 'og:description', content: 'test' },
      { hid: 'og:url', property: 'og:url', content: 'https://test.com/' },
      { hid: 'og:image', property: 'og:image', content: 'https://test.com/assets/image/share/og.png' },
      { hid: 'twitter:card', name: 'twitter:card', content: 'summary_large_image' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
}

Nuxt.jsのそのほか

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0