当前位置:网站首页>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 .
边栏推荐
- Technology: how to design zkvm circuit
- 数据库和缓存如何保持一致性
- The second meeting of the Second Council of Euler open source community was held, and Xinhua III, hyperfusion and Godson Zhongke became members of the Council
- 我的创作纪念日
- Devops note-05: what are the roles of Ba, SM, Po, PM, PD, dev, OPS and QA in the IT industry
- Ling Jing thinks about her own way
- 大神们 在富函数的open中从mysql连接池里取连接 连接池初始化是20个 如果富函数的并行度是1
- [fpga+sin] FPGA implementation of sinusoidal signal generator module based on DDS (direct digital synthesis)
- PATH 与 LD_LIBRARY_PATH 的用法举例
- Zhai Jia: from technical engineer to open source entrepreneur of "net red"
猜你喜欢

How to merge upstream and downstream SQL data records

What is the dry goods microservice architecture? What are the advantages and disadvantages?

PostgreSQL 出现cross-database references are not implemented的bug

Hcie security day41: theoretical learning: information collection and network detection

87. (cesium chapter) cesium thermal map (pasted with terrain)

开发者方案 · 环境监测设备(小熊派物联网开发板)接入涂鸦IoT开发平台

Do you feel confused when you study at three in the morning?

Vg4131sxxxn0s1 wireless module hardware specification

欧拉开源社区第二届理事会第二次会议召开,新华三、超聚变和龙芯中科成为理事会成员单位

干货丨微服务架构是什么?有哪些优点和不足?
随机推荐
c语言 --- 分支结构
How to merge upstream and downstream SQL data records
Four distributed session solutions
Seura 2测试代码总结
【滤波器设计】根据设计指标使用matlab定制滤波器
Hcie security day41: theoretical learning: information collection and network detection
Remote connection of raspberry pie in VNC Viewer Mode
【布里渊现象】光纤布里渊温度和应变分布同时测量系统研究
Preliminary construction of SSM project environment
String不同创建方式的区别
[interview guide] AI algorithm interview
【新功能】Ambire 钱包集成了 Metis 网络
树莓派用VNC Viewer方式远程连接
Data collection and management [9]
Data statistical analysis (SPSS) [5]
为什么说测试岗位是巨坑?8年测试人告诉你千万别上当
【FPGA数学公式】使用FPGA实现常用数学公式
Data collection and management [13]
New listing of operation light 3.0 -- a sincere work of self subversion across the times
赚钱的5个层次,你在哪一层?