【发布时间】:2022-12-15 06:25:47
【问题描述】:
我已经在 Nuxt 文档之后的每个页面中添加了单独的元数据,但是每当我在社交媒体上分享我的链接时,元数据只会显示这个“## build setup”。另一个问题是每个页面都显示相同的元数据。我读到您需要放置“hids”才能拥有单独的页面元数据,但似乎没有任何效果?
索引元:
<script>
export default {
head: {
title: 'Animal Crossing Portal | The Best Tier Lists for Animal Crossing',
meta: [
{ property: 'og:description', hid: 'og:description', name: 'og:description', content: 'Vote monthly in Animal Crossing Tier Lists for New Horizons & Pocket Camp! Including Villager Tier Lists, Sanrio, Gyroids & more at Animal Crossing Portal!' },
{ name: 'twitter:title', hid: 'twitter:title', content: 'Animal Crossing Portal | The Best Tier Lists for Animal Crossing' },
{ name: 'twitter:description', hid: 'twitter:description', content: 'Vote monthly in Animal Crossing Tier Lists for New Horizons & Pocket Camp! Including Villager Tier Lists, Sanrio, Gyroids & more at Animal Crossing Portal!' },
{ name: 'twitter:card', hid: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:image:src', hid: 'twitter:image:src', content: 'https://www.animalcrossingportal.com/images/meta.jpg' },
{ property: 'og:title', hid: 'og:title', name: 'og:title', content: 'Animal Crossing Portal | The Best Tier Lists for Animal Crossing' },
{ property: 'og:type', hid: 'og:type', content: 'website' },
{ property: 'og:site_name', hid: 'og:site_name', content: 'Animal Crossing Portal' },
{ property: 'og:url', hid: 'og:url', content: 'https://www.animalcrossingportal.com/' },
{ property: 'og:image', hid: 'og:image', content: 'https://www.animalcrossingportal.com/images/meta.jpg' }
],
link: [
{
rel: 'canonical',
href: 'https://www.animalcrossingportal.com/'
}
]
}
}
</script>
我的 nuxt.config.js 文件有:
head: {
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
}
【问题讨论】:
-
您是否在项目中搜索了
build setup?你那里有类似的东西吗? -
嘿 kissu 谢谢你的回复,这是我的第一个想法。不幸的是,我的代码中没有任何内容
-
有那个的公共回购协议吗?
-
哦,实际上,有一个例子让我失去了控制!我正在搜索所有文件并在自述文件中找到它。当时什么都没想,因为我认为这只是一个读我!我删除了它,现在可以使用了。非常感谢!
标签: node.js vue.js nuxt.js metadata