Hexo博客开发之——V7.1.1升级到V7.8.0

一 概述

旧版本存在博客数量过多编译时间过长现象,且可能因为文件过多存在编译时出现JavaScript heap out of memory问题,故本次升级到最新稳定版(V7.8.0)

  • cole主题

  • 安装npm依赖最新检测工具

  • 修改项目下的_config.yml(与v7.1.1相比)

  • 修改themes/next下的主题

<!--more-->

二 cole主题

  • 打开hexo-theme-next网址,查看说明向导

  • 打开博客目录,执行git clone指令git clone https://github.com/theme-next/hexo-theme-next themes/next

三 安装npm依赖最新检测工具

  • 安装依赖工具

    npm install -g npm-check-updates
  • 查看最新版本

    ncu 

  • 执行ncu -u进行升级,然后删除现有的node-modules,执行npm install安装新的依赖(由于hexo-renderer-marked 3.0.0版本有bug,使用2.0.0)

    ncu -u

四 修改项目下的_config.yml(与v7.1.1相比)

4.1 permalink_defaults

#add v7.8.0
permalink_defaults:
pretty_urls:
  trailing_index: true 
  trailing_html: true 

4.2 external_link

#add v7.8.0
external_link: 
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''

4.3 hightlight、prismjs

# add v7.8.0
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: '' 
  wrap: true
  hljs: false
prismjs:  
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

4.4 meta_generator

meta_generator: true  

4.5 updated_option

updated_option: 'mtime' 

4.6 v7.1.1升级到v7.8.0后的默认效果

五 修改themes/next下的主题

5.1 _config.yml

5.1.1 修改footer

footer:
  since: 2017 
  icon:
    name: heart 
    animated: false
    color: "#ff0000"
  copyright: pgzxc   
  powered: false

5.1.2 修改beian

beian: 
    enable: true
    icp: 京ICP备xxx
    gongan_id:
    gongan_num:
    gongan_icon_url:

5.1.3 Schemes

scheme: Gemini

5.1.4 menu

menu: 
  home: / || fa fa-home
  archives: /archives/ || fa fa-archive
  categories: /categories/ || fa fa-th
  tags: /tags/ || fa fa-tags
  comments: /comments/ || fa fa-comments 
menu_settings:
  icons: true
  badges: true #modify 2020-08-12

5.1.5 avatar

avatar: 
  url: /images/avatar.jpg
  rounded: true
  rotated: false

5.1.6 social

social:
  GitHub: https://github.com/PGzxc || fab fa-github
  CSDN: http://blog.csdn.net/calvin_zhou || fab fa-book
  微博: http://weibo.com/5582039920 || fab fa-weibo
  简书: http://www.jianshu.com/u/c5cdcb4dc52b || fab fa-heartbeat
social_icons:
  enable: true
  icons_only: false
  transition: false

5.1.7 link

links_settings:
  icon: fa fa-link
  title: 友情链接
  # Available values: block | inline
  layout: inline
​
links:
  鸿洋: https://wanandroid.com/

5.1.8 comment

livere_uid: MTAyMC8zMjQ1OC85Msxxx

5.1.9 leancloud_visitors

leancloud_visitors: 
  enable: false
  app_id: xoStNXjq2xNoDRjTltoOztdq-gzGzoHsz
  app_key: 6g89MPFNvTH2YHnKMAK1n1V8

5.1.10 busuanzi_count

busuanzi_count:
  enable: true
  total_visitors: true
  total_visitors_icon: fa fa-user
  total_views: true
  total_views_icon: fa fa-eye
  post_views: true
  post_views_icon: fa fa-eye

5.1.11 local_search

local_search: 
  enable: true
  trigger: auto
  top_n_per_article: 1
  unescape: false
  preload: false

5.2 language/zh-CN.yml

menu:  
  home: 首页
  archives: 归档
  categories: 分类
  tags: 标签
  about: 关于
  search: 搜索
  comments: 留言板 #add 2020-08-12
  schedule: 日程表
  sitemap: 站点地图
  commonweal: 公益 404

猜你喜欢

转载自blog.csdn.net/Calvin_zhou/article/details/107967989