当前位置:网站首页>Nuxt - set SEO related tags, page titles, icons, etc. separately for each page (page configuration head)
Nuxt - set SEO related tags, page titles, icons, etc. separately for each page (page configuration head)
2022-06-29 04:04:00 【Wangjiabin】
Preface
You must know , To configure some
SEORelated tags , It should be under the project root directorynuxt.config.js→headThe fields go .
Please note that ,nuxt.config.js What is configured in the file is global ,
Is not “ Independent ” Apply to each page , That is, all pages use this global configuration .
But if you want more “ comprehensive SEO” , You must for each page Set separately .
Solution
Nuxt Provides a convenient hook , It allows us to easily define .
for example index.vue page , The code configured for it is as follows :
<template>
<div>
...
</div>
</template>
<script> export default {
data() {
return {
} }, // And data Hook function sibling head() {
// Directly return all SEO Related and page configuration return {
title: " I'm the title ", meta: [ {
charset: "utf-8" }, {
name: "viewport", content: "width=device-width, initial-scale=1" }, {
hid: "description", name: "description", content: " I'm the home page , This is the description " }, {
name: "renderer", content: "webkit" }, // More labels ... ], // This page icon // link: [{ rel: "icon", type: "image/x-icon", href: "/favicon1.ico" }], } }, } </script>
Each page has head() This hook function .
边栏推荐
- Distributed ID solution
- Logstash starts too slowly or even gets stuck
- 百度智能云服务网格产品CSM发布 | 火热公测中
- Hcie security day41: theoretical learning: information collection and network detection
- The efficiency of 20 idea divine plug-ins has been increased by 30 times, and it is necessary to write code
- Vg4131sxxxn0s1 wireless module hardware specification
- Draft competition process of Intelligent Vision Group
- What is the dry goods microservice architecture? What are the advantages and disadvantages?
- Microsecond TCP timestamp
- Web crawler knowledge day04
猜你喜欢

Establishment of small and medium-sized enterprise network

Go implements distributed locks

Seura 2测试代码总结

How to keep database and cache consistent

赚钱的5个层次,你在哪一层?

moudo网络库剖析

The efficiency of 20 idea divine plug-ins has been increased by 30 times, and it is necessary to write code

Set hardware breakpoint instruction for ejtag under the PMON of the Godson development board

【FPGA数学公式】使用FPGA实现常用数学公式

数据库和缓存如何保持一致性
随机推荐
Data collection and management [12]
If you choose the right school, you can enter Huawei as a junior college. I wish I had known
Does cdc2.2.1 not support postgresql14.1? Based on the pgbouncer connection mode, with 5433
【布里渊现象】光纤布里渊温度和应变分布同时测量系统研究
Adelaidet (detectron2) & abcnet environment configuration
【C语言】 详解线程退出函数 pthread_exit
Yangzhou needs one English IT Helpdesk Engineer -20220216
SQL two columns become multi row filter display
科班出身,结果外包都不要
leetcode - 295. Median data flow
Kingbase export table structure
Baidu AI Cloud service grid product CSM release 𞓜 hot public beta
点云地图导入gazebo思路
[interview guide] AI algorithm interview
微秒级 TCP 时间戳
Error: schema validation failed with the following error: the data path '' should not have other properties (projects)
The efficiency of 20 idea divine plug-ins has been increased by 30 times, and it is necessary to write code
Use gstarwmr video conversion for yocto system of i.mx8m development board
情绪的变化需要控制
Why are you a test / development programmer? Can you recall