如何解决Nuxt 静态站点 - 标记在哪里?
我已将模式设置为静态并运行 npm run generate。该站点是从 /dist/ 目录提供的,但是当我查看源代码时,标记在哪里?查看源:https://eosnomad.com/
我不认为我在这里获得了 SEO 的好处,因为 Google 看不到 HTML。我只在查看开发工具时看到源代码。我这样做错了吗?
这是我的 nuxt 配置:
export default {
target: 'static',head: {
title: process.env.DOMAIN,meta: [
{ charset: 'utf-8' },{ name: 'viewport',content: 'width=device-width,initial-scale=1' },{
hid: 'description',name: 'description',content:
process.evn.CONTENT,},],link: [{ rel: 'icon',type: 'image/x-icon',href: '/favicon.ico' }],css: [],plugins: [
{ src: '~/plugins/cookie-law',mode: 'client' },{ src: '~/plugins/vue-agile',{ src: '~/plugins/vue-js-modal',{ src: '~/plugins/vue-formulate',{ src: '~/plugins/vue-the-mask',{ src: '~/plugins/route-to-hash',{ src: '~/plugins/global-components',components: true,publicRuntimeConfig: {
baseSiteTitle: '${DOMAIN}',siteID: '${WORDPRESS_SITE_ID}',cmsEndpoint: process.env.IS_LOCAL
? 'https://dashboard${TLD_LOCAL}/${WORDPRESS_SITE_SLUG}/${WORDPRESS_ACF_ENDPOINT}'
: 'https://dashboard${TLD}/${WORDPRESS_SITE_SLUG}/${WORDPRESS_ACF_ENDPOINT}',newsEndpoint: process.env.IS_LOCAL
? 'https://dashboard${TLD_LOCAL}/wp-json/getnews?property_id=${WORDPRESS_SITE_ID}'
: 'https://dashboard${TLD}/wp-json/getnews?property_id=${WORDPRESS_SITE_ID}',tailwindcss: {
exposeConfig: true,loading: false,buildModules: [
'@nuxtjs/tailwindcss','@nuxtjs/pwa',[
'@teamnovu/nuxt-breaky',{
enabled: true,enableInProd: false,colorScheme: 'auto',position: 'bottomRight',modules: [
'@nuxtjs/axios','@nuxtjs/svg','nuxt-fontawesome','@nuxtjs/dayjs',['vue-scrollto/nuxt',{ duration: 1000,easing: 'ease-in-out' }],dayjs: {
plugins: ['isSameOrAfter','isSameOrBefore'],fontawesome: {
imports: [
{
set: '@fortawesome/free-solid-svg-icons',icons: [
'faBullhorn','faSortUp','faSortDown','faUtensils','faEnvelopeOpenText','faArrowLeft','faArrowRight','faTimesCircle',{
set: '@fortawesome/free-brands-svg-icons',icons: ['faFacebookSquare','faTwitterSquare','faInstagram'],webfontloader: {
typekit: {
id: 'XXXX',render: {
bundleRenderer: {
shouldPreload: (file,type) => {
return ['script','style','font'].includes(type)
},// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {},// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {},}
解决方法
我明白了。这是一个单页网站,我将所有组件放在默认布局文件中。为了正确生成静态标记,所有这些都需要在 index.vue 文件中。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。