LoginSignup
5
1

More than 3 years have passed since last update.

【Nuxt.js】faviconを設定する(nuxt.config.jsでmetaタグ情報を設定)

Last updated at Posted at 2020-03-04
  • メモ
    • metaタグの情報は、nuxt.config.jsで設定する
    • favicon画像はstaticフォルダへ配置する
    • href: "/favicon.ico"とした場合、static/favicon.icoのファイルが呼び出される
nuxt.config.js
export default {

  省略

  head: {
    title: process.env.npm_package_name || "",
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      {
        hid: "description",
        name: "description",
        content: process.env.npm_package_description || ""
      }
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
  },

  省略

}
5
1
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
5
1