next v5升级到next v7需要注意的地方


title: next v5升级到next v7需要注意的地方
date: 2020-03-04
categories: web
tags: [hexo,next]

大部分的设置都是一样的,但有一些细节要注意

1.背景图片的设置:next v5.X 在source/css/_cumtom.styl设置, 而next v7.x 修改两处:

“next主题配置文件“ _config.yml中

custom_file_path:
  #head: source/_data/head.swig
  #header: source/_data/header.swig
  #sidebar: source/_data/sidebar.swig
  #postMeta: source/_data/post-meta.swig
  #postBodyEnd: source/_data/post-body-end.swig
  #footer: source/_data/footer.swig
  #bodyEnd: source/_data/body-end.swig
  #variable: source/_data/variables.styl
  #mixin: source/_data/mixins.styl
  style: source/_data/styles.styl      #这里去掉了注释的#

然后在 “站点根目录“ source新建文件夹 _data,其中新建styles.styl文件,在文件里设置。(这里 source/是网站根目录,若是/source就是主题目录)

@media screen and (min-1200px) {


    #footer a {
        color:#eee;
    }



body {
      background: url(/images/bg1.jpg);
      background-size: cover;
      background-repeat: no-repeat;
      background-attachment: fixed;
      background-position: 50% 50%;
}

}

2. “next主题配置文件” _config.yml 中social 和social icon的设置。

2.1next v5 可以添加一些其他的链接,比如cnblog,但是v7好像不可以。 否则会出现打开网页空白的现象。

2.2另外比如说添加了Github的链接,就要把Github的注释去掉,不要重复。

正确的如下

social:
  GitHub: https://github.com/TouwaErioH || github
  E-Mail: mailto:eriovar@163.com || envelope
  #Weibo: https://weibo.com/yourname || weibo
  #Google: https://plus.google.com/yourname || google
  #Twitter: https://twitter.com/yourname || twitter
  #FB Page: https://www.facebook.com/yourname || facebook
  #StackOverflow: https://stackoverflow.com/yourname || stack-overflow
  #YouTube: https://youtube.com/yourname || youtube
  #Instagram: https://instagram.com/yourname || instagram
  #Skype: skype:yourname?call|chat || skype

social_icons:
  enable: true
  icons_only: false
  transition: false
原文地址:https://www.cnblogs.com/lqerio/p/13485183.html