• 网站图标
     small: /images/icon.jpeg
     apple_touch_icon: /images/icon.jpeg
     safari_pinned_tab: /images/logo.svg

  • 网站底部小人换成心形

  # Specify the date when the site was setup.
  # If not defined, current year will be used.
  #since: 2015  #此处可设置网站建站时间

  # Icon between year and copyright info.
    # Icon name in fontawesome, see: https://fontawesome.com/v4.7.0/icons/
    # heart is recommended with animation in red (#ff0000).
    name: heart
    # If you want to animate the icon, set it to true.
    animated: false
    # Change the color of icon, using Hex Code.
    color: "#808080"
  • 备案
    enable: true
    icp: 你的备案号
  • 社交网站图标链接(把想要显示的网站前面#去掉,改为自己的网站链接,并将下面的social_icons的enable属性设为true就ok)
    # Social Links
    # Usage: Key: permalink || icon
    # Key is the link label showing to end users.
    # Value before || delimeter is the target permalink.
    # Value after || delimeter is the name of FontAwesome icon. If icon (with or without delimeter) is not specified, globe icon will be loaded.
      GitHub: https://github.com/dasnnj || github
      E-Mail: mailto:dasnnj@outlook.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
      #VK Group: https://vk.com/yourname || vk
      #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

  enable: true #设为true
  icons_only: false 
  transition: false
  • 头像
# Sidebar Avatar
  # in theme directory(source/images): /images/avatar.gif
  # in site  directory(source/uploads): /uploads/avatar.gif
  # You can also use other linking images.
  url: /images/icon.jpeg
  # If true, the avatar would be dispalyed in circle.
  rounded: true #显示圆形头像
  # The value of opacity should be choose from 0 to 1 to set the opacity of the avatar.
  opacity: 1
  # If true, the avatar would be rotated with the cursor.
  rotated: false  #设为true则鼠标移到头像上时候,鼠标显示为手
  • 显示摘要 (下面的enable设为true即按照下面设定的高度显示摘要;官方推荐使用<!– more –>自定义摘要长度;
# Automatically Excerpt. Not recommend.
# Use  in the post to control excerpt accurately.
# 显示摘要,不显示全文
  enable: false 
  length: 150

# Read more button
# If true, the read more button would be displayed in excerpt section.
read_more_btn: true


  • 打赏功能
# Reward
# If true, reward would be displayed in every article by default.
# And you can show or hide one article specially through add page variable reward: true/false.
# 打赏
  enable: true
  comment: 坚持原创技术分享,您的支持将鼓励我继续创作!
  wechatpay: /images/xxx.png
  alipay: /images/xxx.jpg
  # bitcoin: /images/unionpay.jpg
  • 网站访问次数统计
  enable: true
  total_visitors: true
  total_visitors_icon: user
  total_views: true
  total_views_icon: eye
  post_views: true
  post_views_icon: eye
  • 本地搜索(需要npm安装denpendency)
# Local search
# Dependencies: https://github.com/theme-next/hexo-generator-searchdb
  enable: true
  # if auto, trigger search by changing input
  # if manual, trigger search by pressing enter key or search button
  trigger: auto
  # show top n results per article, show all results by setting to -1
  top_n_per_article: 1
  # unescape html strings to the readable one
  unescape: false

参考主题提供的github地址https://github.com/theme-next/hexo-generator-searchdb, 在博客根目录下执行npm install hexo-generator-searchdb --save

  • 图片弹出效果(鼠标移到图片上显示放大镜效果)请参考:https://github.com/theme-next/theme-next-fancybox3.

    进入next主题目录下执行git clone https://github.com/theme-next/theme-next-fancybox3 source/lib/fancybox
    通过配置fancybox,让网站中图片可以放大(注意最终效果是clone到主题下面的source/lib/fancybox里面,而不是项目根目录的source/lib/fancybox),然后在主题配置的_config.yml中,搜索fancybox,改为fancybox: true

# Fancybox. There is support for old version 2 and new version 3.
# Choose only any one variant, do not need to install both.
# To install 2.x: https://github.com/theme-next/theme-next-fancybox
# To install 3.x: https://github.com/theme-next/theme-next-fancybox3
fancybox: true

  • 压缩代码(我使用的是all_minifier来优化代码)具体请参考:https://github.com/chenzhutian/hexo-all-minifier
    博客根目录下执行npm install hexo-all-minifier --save
    在nexT主题的_config.yml中添加 all_minifier:true
    无需其他操作,便可在执行hexo g生成静态代码时候自动压缩


var gulp = require('gulp');

var minifycss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var htmlmin = require('gulp-htmlmin');
var htmlclean = require('gulp-htmlclean');
gulp.task('minify-css', function () {
  return gulp.src('./public/**/*.css')
gulp.task('minify-html', function () {
  return gulp.src('./public/**/*.html')
    removeComments: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true,

//压缩js 不压缩min.js
gulp.task('minify-js', function () {
  return gulp.src(['./public/**/*.js', '!./public/**/*.min.js'])

//gulp.task('default', [
  //  'minify-html', 'minify-css', 'minify-js'
// 执行 gulp 命令时执行的任务
gulp.task('default', gulp.parallel('minify-html', 'minify-css', 'minify-js', function() {
  // Do something after a, b, and c are finished.
  return new Promise(function(resolve, reject) {
    console.log("gulp finished");


分类: techtool

0 条评论