当前位置: 首页 > news >正文

中国优秀网站设计网站开发完整教程

中国优秀网站设计,网站开发完整教程,什么网站免费做推广,毕业设计做网站有哪些方面1 SiteMap设置 环境准备 注意生成sitemap依赖于nuxtjs/sitemap#xff0c;并且需要用axios进行请求#xff0c;不要使用nuxtjs/axios#xff0c;不然会报错 sitemap.xml配置 在nuxt.config.js中配置下面的内容 npm install nuxtjs/sitemap npm install axios在static/s…1 SiteMap设置 环境准备 注意生成sitemap依赖于nuxtjs/sitemap并且需要用axios进行请求不要使用nuxtjs/axios不然会报错 sitemap.xml配置 在nuxt.config.js中配置下面的内容 npm install nuxtjs/sitemap npm install axios在static/sitemap.js中配置下面的内容 const webConfig {// 本地local: {baseURL: http://localhost:8828,referer: http://localhost:8828/,url: http://localhost:8828},// sit环境sit: {baseURL: ,referer: ,url: },// 线上环境production: {baseURL: ,referer: /,url: } }import axios from axios // 运行环境是不是开发环境 const isDev Boolean(process.env.OPE_ENV development) const API_ENV process.env.API_ENV // 接口url const baseUrl webConfig[API_ENV].baseURL // referer const referer isDev ? webConfig[local].referer : webConfig[API_ENV].referer // 网站域名 const hostname isDev ? webConfig[local].url : webConfig[API_ENV].urlconst config {baseURL: baseUrl,withCredentials: true,time: Date.now(),headers: {Accept: application/json; charsetutf-8,Referer: referer,common: {languageCode: zh-CN,referer: referer}} } const sitemap {path: /sitemap.xml, //生成的文件路径hostname: hostname, //网站的网址cacheTime: 1000 * 60 * 60 * 24, //一天的更新频率只在generate:false有用gzip: true, //生成.xml.gz的sitemapgenerate: false,// 排除不要页面exclude: [/404,/page,/details,/article,/tags,/category,/search],defaults: {changefred: always,lastmod: new Date(),priority: 0.8},routes: async () {let routes []let res await axios.get(${baseUrl}/api/getArticle, {})if (res.code 200) {res.list.forEach((item) {routes.push({url: /xxxx/${item.pageCode},changefreq: always,priority: 0.9})})}return routes} } module.exports sitemap 在nuxt.config.js中配置下面的内容 const sitemap require(./static/sitemap)module.exports {...,sitemap: sitemap, } 2 robots.txt协议 在nuxt项目的static文件夹下配置项目的静态文件直接在static新建robots.txt即可nuxt运行时会自动装配到根路由 # 该文件可以通过网站域名/Robots.txt直接访问# User-agent作用描述搜索引擎的名字对于该文件来说至少药有一条user-agent记录则该项的值设为* User-agent: * # Disallow: 描述不希望被访问到的一个url Disallow: /cart?* Disallow: /*Cart-* Disallow: /*retailavailability Allow: /*wishlist*.js Sitemap: 网站的域名/sitemap.xml3 seo优化 全局seo在nuxt.config.js的meta中添加网站的字符编码、语言、响应式标签、网站描述、网站关键字等信息在link中添加全局的css、网站logo等信息。 head: {title: pkg.name,meta: [{ charset: utf-8 },{ name: viewport, content: widthdevice-width, initial-scale1 },{ hid: description, name: description, content: pkg.description }],link: [{ rel: icon, type: image/x-icon, href: /favicon.ico }]},页面seo在nuxt.js项目pages路由页面的script中添加head方法该方法将随nuxt运行时自动载入 head () {return {title: ${this.info.blogName} | ${this.info.blogDescription},meta: [{ name: keywords, content: this.info.keywords },{ name: description, content: this.info.description }]} }
http://www.yutouwan.com/news/370127/

相关文章:

  • 郑州专业网站设计公司地址网站建设综合技能实训
  • 为什么网站开发这么便宜免费saascrm
  • 如何自己做网站腾讯工业设计介绍
  • wordpress建购物网站汇办公app安卓版本
  • 网站虚拟机可以自己做吗学院网站建设项目
  • 网站网页优化技巧绵阳市城市建设档案馆网站
  • php做的购物网站代码楼盘推荐排行榜
  • wordpress网站主题seo课程多少钱
  • 专业建站公司费用地产网站模板
  • 祥云平台做网站好不好做宣传图片的软件
  • 免费软件下载官方网站好的网站怎么设计师
  • 网站建设价格济南济南做网站比较好的
  • 网站平台搭建怎么弄的温州人才网站开发
  • 网站做游戏活动策划方案福建网站建设模板
  • 云指网站开发搭建钓鱼网站教程
  • 做cps要做什么类型的网站最新的新闻 最新消息
  • 网站是由多个网页组成的吗wordpress 加水印
  • 做网站用的字体是什么网站建设对客户的影响
  • 荣耀商城官网网站群辉域名登录wordpress
  • 长春火车站地址wordpress默认模板目录在哪里
  • 邢台企业做网站费用建立自己网站要多少钱
  • 哪些购物网站用php做的iis网站防盗链
  • 长春网站建设多少钱saas小程序开发费用
  • 平湖模板网站建设公司建湖哪家专业做网站
  • 建工网站4徐汇区网站建设
  • 昆明官方网站建设秦皇岛网站推广
  • 谷歌做新媒体运营的网站做网站之前的工作
  • 手机制作网站的软件有哪些内容做销售在哪个网站找客户端
  • 职业做网站游戏的西安新闻头条最新消息
  • wordpress中一个侧面导航实现异步昆明seo外包