资料区

官方教程

官方主题设置:http://theme-next.iissnan.com/theme-settings.html
初始设置:http://theme-next.iissnan.com/getting-started.html#avatar-setting
官方next主题博客地址(含有教程):https://theme-next.js.org/docs/

各类主题优化

hexo主题安装以及next8.0主题美化
开启留言功能
进阶博客文章美化
NexT主题的优化定制修改指南(比较好)
Hexo+next主题配置踩的坑 2020.3.29发布
Ubuntu + Hexo + Next 8.0 进阶美化篇二自定义美化页面
hushankaijia(美化主题)
Hexo+NexT(零):最全Hexo+Next搭建博客教程(六篇文章)

优秀Next博客主

浅笑的博客
z小璇 Hexo-Next 主题博客个性化配置超详细,超全面(两万字) 2020.3.10发布
你真是一个美好的人类 (较完整教程)
苏寅 Blog(有教程)
小世界(含有教程)
it’s neko deng

其他优秀博客主

听风(搭建在博客园)


各种初始设置

语言设置

路径:D:\blog\changluBlog_config.yml
QQ截图20200827145255.jpg
这个language对应着next主题中的language文件夹下的zh-CN(就是我设置的对应名称)
简单来说:就是hexo中的配置文件对应next主题下的language文件夹下的对应名称
QQ截图20200827145446.jpg

主题设置

路径:D:\blog\changluBlog\themes\next
image.png

页面显示
实际是双栏的效果,在此之前进行了语言设置以及发布了一篇文章
image.png

菜单显示

说明:在next下的配置文件里的menu打开即可。
QQ截图20200827145803.jpg

头像设置

添加头像

① 在source目录中新建文件夹images,并放入照片按照以下形式即可
QQ截图20200827151112.jpg
② 在next的主题配置文件中对avator的url进行配置:
QQ截图20200827151237.jpg
规范要求看如下:
QQ截图20200827151359.jpg

显示情况:
QQ截图20200827151504.jpg

设置头像为圆形以及点击旋转效果

在next主题目录下的配置文件,将对应两个选项设置为true即可。
image.png

效果展示:
GIF.gif

设置文章目录

image.png

添加标签页面(3步骤)

① 输入命令:hexo new page tags
QQ截图20200828223229.jpg
QQ截图20200828223454.jpg

② 在tags目录中的index.md设置相应的内容

  1. ---
  2. title: tags
  3. date: 2020-08-28 22:30:33
  4. type: "tags"
  5. ---

QQ截图20200828223836.jpg

③ 在主题配置文件中打开对应menu下的标签
QQ截图20200828224137.jpg

展示:
QQ截图20200828224846.jpg


添加分类页面(3步骤)

① 在博客目录下输入命令:hexo new page categories
QQ截图20200828225001.jpg

② 编辑刚新建的页面,将页面的 type 设置为 categories ,主题将自动为这个页面显示分类。页面内容如下:

title: 分类
date: 2014-12-22 12:39:04
type: "categories"
---

QQ截图20200828225533.jpg

③ 在菜单中添加链接。编辑 主题配置文件 , 添加 categories 到 menu 中,如下:
QQ截图20200828225602.jpg

显示效果:
QQ截图20200828225658.jpg

侧边栏社交链接

对应图标网站(选择你想要的都有):https://fontawesome.dashgame.com/
image.png

主题配置文件中设置:
image.png

对于qq打开链接+好友 对应uin后改为你的qq号即可

http://wpa.qq.com/msgrd?v=3&uin=939974883&site=qq&menu=yes


更换网站logo(三步骤)

如下图对应logo更换:
QQ截图20200830234457.jpg

① 去制作一个32*32的icon图标

制作网站:https://tool.lu/favicon/
上传制作即可

② 将icon放置在source/images目录下
QQ截图20200830234849.jpg

③ 到主题配置文件中修改即可,如下
QQ截图20200830234815.jpg

设置进度条

主题配置文件中:
image.png

如何设置首页阅读全文

在你的markdown文章中,添加,自动会设置对应阅读全文部分

如下:
image.png

设置搜索功能(v8)

在主题配置文件中:打开即可
image.png

博客添加2d模型

阅读博客:Hexo添加Live2D看板娘最新教程

① 安装依赖

取消看板娘:npm uninstall hexo-helper-live2d

输入命令安装依赖:npm install --save hexo-helper-live2d
遇到这种就运行npm audit fix,如果还不成功,会提示你用npm audit fix --force,一般这个时候就成功了。
成功了之后可以看到当前目录的node_modules/下有个live2d-widget目录,这是动画的主配置:
image.png

说明:这个时候是没有模型文件的,所以下一步是下载模型文件

② 下载model文件

输入命令:npm install live2d-widget-model-shizuku
命令的最后model- 对应的模型的名称,我们可以到对应博客查看你想要的模型:Hexo添加Live2D看板娘+模型预览
image.png

③ 添加live2d看板娘到Hexo目录下的配置文件

我的配置:

## Live2D看板娘
live2d:
  enable: true
  pluginModelPath: assets/
  model:
    #模板目录,在node_modules里
    use: live2d-widget-model-shizuku 
  display:
    position: right
    width: 150 
    height: 300
  mobile:
    # 在手机端显示
    show: true   
  rect:
    opacity:0.7

配置详细描述:

# Live2D
## https://github.com/EYHN/hexo-helper-live2d
live2d:
  enable: true
  # enable: false
  scriptFrom: local # 默认
  pluginRootPath: live2dw/ # 插件在站点上的根目录(相对路径)
  pluginJsPath: lib/ # 脚本文件相对与插件根目录路径
  pluginModelPath: assets/ # 模型文件相对与插件根目录路径
  # scriptFrom: jsdelivr # jsdelivr CDN
  # scriptFrom: unpkg # unpkg CDN
  # scriptFrom: https://cdn.jsdelivr.net/npm/live2d-widget@3.x/lib/L2Dwidget.min.js # 你的自定义 url
  tagMode: false # 标签模式, 是否仅替换 live2d tag标签而非插入到所有页面中
  debug: false # 调试, 是否在控制台输出日志
  model:
    use: live2d-widget-model-wanko # npm-module package name
    # use: wanko # 博客根目录/live2d_models/ 下的目录名
    # use: ./wives/wanko # 相对于博客根目录的路径
    # use: https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json # 你的自定义 url
  display:
    position: right
    width: 150
    height: 300
  mobile:
    show: true # 手机中是否展示

使用hexo -g生成文件**,接着使用hexo server,来进行预览查看


配置文件

next主题配置文件

自动清除无用文件

image.png
**


打开文章末尾的版权信息

image.png


效果展示:
image.png
**


菜单栏显示分类 / 标签中的文章数目

image.png

效果展示:
image.png


修改文章底部标签的样式

# Use icon instead of the symbol # to indicate the tag at the bottom of the post
tag_icon: true

效果:
image.png

SEO优化

# ---------------------------------------------------------------
# SEO Settings
# See: https://theme-next.js.org/docs/theme-settings/seo
# ---------------------------------------------------------------

# Disable Baidu transformation on mobile devices.
disable_baidu_transformation: false

# If true, site-subtitle will be added to index page.
# Remember to set up your site-subtitle in Hexo `_config.yml` (e.g. subtitle: Subtitle)
index_with_subtitle: true

# Automatically add external URL with Base64 encrypt & decrypt.
exturl: true

# Google Webmaster tools verification.
# See: https://www.google.com/webmasters
google_site_verification:

# Bing Webmaster tools verification.
# See: https://www.bing.com/webmaster
bing_site_verification:

# Yandex Webmaster tools verification.
# See: https://webmaster.yandex.ru
yandex_site_verification:

# Baidu Webmaster tools verification.
# See: https://ziyuan.baidu.com/site
baidu_site_verification:

# Enable baidu push so that the blog will push the url to baidu automatically which is very helpful for SEO.
baidu_push: true

文章创建时间和更新时间

# Post meta display settings
post_meta:
  item_text: true
  created_at: true
  updated_at:
    enable: true
    another_day: true
  categories: true

第三方插件

# Math Formulas Render Support
# Server-side plugin: https://github.com/next-theme/hexo-filter-mathjax
math:
  # Default (true) will load mathjax / katex script on demand.
  # That is it only render those page which has `mathjax: true` in Front-matter.
  # If you set it to false, it will load mathjax / katex srcipt EVERY PAGE.
  per_page: true

  # hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
  # 渲染文档中的类Latex格式书写的数学公式
  mathjax:
    enable: true

  # hexo-renderer-markdown-it-plus (or hexo-renderer-markdown-it with markdown-it-katex plugin) required for full Katex support.
  katex:
    enable: false
    # See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
    copy_tex: false

# Easily enable fast Ajax navigation on your website.
# For more information: https://github.com/next-theme/pjax
pjax: false

# FancyBox is a tool that offers a nice and elegant way to add zooming functionality for images.
# For more information: https://fancyapps.com/fancybox
# 一款基于jquery开发的类Lightbox插件。支持对放大的图片添加阴影效果,对于一组相关的图片添加导航操作按纽
fancybox: true

# A JavaScript library for zooming images like Medium.
# Do not enable both `fancybox` and `mediumzoom`.
# For more information: https://github.com/francoischalifour/medium-zoom
mediumzoom: false

# Vanilla JavaScript plugin for lazyloading images.
# For more information: https://github.com/ApoorvSaxena/lozad.js
# 高性能、轻巧和可配置的延迟加载器
lazyload: true

# Pangu Support
# For more information: https://github.com/vinta/pangu.js
# Server-side plugin: https://github.com/next-theme/hexo-pangu
# 神器啊,盘古之白:自动在中文字和半形的英文、数字、符号之间插入空白。
pangu: false

# Quicklink Support
# For more information: https://github.com/GoogleChromeLabs/quicklink
# Front-matter variable (unsupport home archive).
# 通过在空闲时间预取in-viewport链接来加快后续页面加载速度。
quicklink:
  enable: true

  # Home page and archive page can be controlled through home and archive options below.
  # This configuration item is independent of `enable`.
  home: true
  archive: true

  # Default (true) will initialize quicklink after the load event fires.
  delay: true
  # Custom a time in milliseconds by which the browser must execute prefetching.
  timeout: 3000
  # Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]).
  priority: true

  # For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores.
  # See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns
  ignores:

主题设定

帖子

发布字数统计

① 安装hexo-word-counter

在博客根目录下输入命令:npm install hexo-word-counter

② 在主题配置文件中

# Post wordcount display settings
# Dependencies: https://github.com/next-theme/hexo-word-counter
symbols_count_time:
  symbols: true
  time: true
  total_symbols: true
  total_time: true
  awl: 4
  wpm: 275
  separated_meta: true
  item_text_post: true
  item_text_total: true

③ next主题配置文件中打开

image.png

文章顶部以及底部都有统计**
image.png
image.png

搜索引擎优化

seo设置:在主题配置文件下
image.png

文章边框优化

参考文章:https://zhuanlan.zhihu.com/p/252983030?utm_source=com.miui.notes

文章增加阴影

找到对应目录下内容,添加即可
image.png

.post-block{
        background-color: rgba(255, 255, 255, 1);
        margin-bottom: 24px;
        padding: 20px;
        border-radius: 30px 30px 30px 30px;
        box-shadow: 8px 7px 2px 0 rgba(0,0,0,0.12), 7px 4px 1px -2px rgba(0,0,0,0.06), 0 1px 5px 0 rgba(0,0,0,0.12);
}


加阴影前后:**
image.png

image.png

背景设置透明

image.png
background-color: rgba(255, 255, 255, 0);

效果展示:
image.png


文章置顶位置向上一些

image.png

查找到对应的位置:
image.png

也就是文章增加阴影部分的top去掉即可
image.png

文章组件位置向上靠

参考文章:https://zhuanlan.zhihu.com/p/252983030?utm_source=com.miui.notes

因为我使用的是的主题是Pisces,那么我们就在这里找到对应layout布局:
image.png
image.png 这是引用的一个值

我们接着找到对应设置的值:
image.png
设置:$content-desktop-padding = 20px;
分别表示上右下左

设置前:
image.png

设置后:
image.png

设置head头部边框为椭圆形

首先定位位置:
image.png
box-shadow: 8px 7px 2px 0 rgba(0,0,0,0.12), 7px 4px 1px -2px rgba(0,0,0,0.06), 0 1px 5px 0 rgba(0,0,0,0.12);
给头部边框加阴影

我们找到在对应_variables中对应的变量名,更改即可:$border-radius-inner = 30px 30px 30px 30px;
image.png

效果展示:
image.png

设置侧边栏为椭圆形

image.png

我们进行搜索:
image.png

image.png
border-radius: 30px;
box-shadow: 8px 7px 2px 0 rgba(0,0,0,0.12), 7px 4px 1px -2px rgba(0,0,0,0.06), 0 1px 5px 0 rgba(0,0,0,0.12);
下面是阴影(后来添加的)

效果展示:
image.png


去除顶端的黑线

next\source\css_schemes\Pisces_layout.styl目录下添加:
.headband {display:none;}

image.png

去除前:
image.png

去除后:
image.png

最终优化效果(总结)

image.png
如果我们要修改对应文章的样式可以在对应主题中选择,如Gemini、Pisces主题,
由于Pisces主题中文章距离最上面边界不太行,就使用了Gemini。

一般对应的布局都在这几个文件夹中。

通常常量:$content-desktop-padding = 20; 在base.styl中

侧边栏布局:.sidebar-inner 在对应主题的_sidebar.sty中
头部布局:.sidebar-inner 在对应主题的_layout.styl中
文章布局:.post-block 在对应layout.styl中自己手动添加 Gemini中自带有此属性


文章字体优化

themes\next\source\css_variables目录下:
image.png
到对应页面中修改字体的大小

原始字体:

$font-size-smallest       = .75em;
$font-size-smaller        = .8125em;
$font-size-small          = .875em;
$font-size-medium         = 1em;
$font-size-large          = 1.125em;
$font-size-larger         = 1.25em;
$font-size-largest        = 1.5em;

更改后:

$font-size-smallest       = .65em
$font-size-smaller        = .75em;
$font-size-small          = .8em;

详细说明

我们想要修改对应文章的字体,如何修改呢?
我们检查元素,查看对应继承关系,找到.post-body
image.png

image.png
我们在对应配置文件中找到.post-body,增加属性的设置:font-size: 1em;

完美,这就更改了对应文章的字体大小。
image.png


页脚

网站页脚图标

在主题配置文件中设置:
image.png

设置动画效果展示:
GIF.gif


功能添加

腾讯公益404页面

使用方法,新建 404.html 页面,放到主题的 source 目录下,内容如下:

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="robots" content="all" />
  <meta name="robots" content="index,follow"/>
  <link rel="stylesheet" type="text/css" href="https://qzone.qq.com/gy/404/style/404style.css">
</head>
<body>
  <script type="text/plain" src="http://www.qq.com/404/search_children.js"
          charset="utf-8" homePageUrl="/"
          homePageName="回到我的主页">
  </script>
  <script src="https://qzone.qq.com/gy/404/data.js" charset="utf-8"></script>
  <script src="https://qzone.qq.com/gy/404/page.js" charset="utf-8"></script>
</body>
</html>

使用效果:如果访问到不存在页面即可显示404页面,如下:
QQ截图20200827232912.jpg

添加动态背景

① 在next目录下的layout目录下的_layout.njk中最后标签前添加三行语句

  {% if theme.canvas_nest %}
    <script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
  {% endif %}

QQ截图20200828234520.jpg

② 在主题配置文件下开启背景
主题配置文件的最后方,添加内容:

# --------------------------------------------------------------
# background settings
# --------------------------------------------------------------
# add canvas-nest effect
# see detail from https://github.com/hustcc/canvas-nest.js
canvas_nest: true

QQ截图20200828234647.jpg

特效展示:
对应线条会跟着你的鼠标移动
QQ截图20200828234805.jpg

点击爆炸效果(3步骤)

① 在next/source/schemes/目录中新建一个js并且将代码拷入
QQ截图20200829123303.jpg

"use strict";function updateCoords(e){pointerX=(e.clientX||e.touches[0].clientX)-canvasEl.getBoundingClientRect().left,pointerY=e.clientY||e.touches[0].clientY-canvasEl.getBoundingClientRect().top}function setParticuleDirection(e){var t=anime.random(0,360)*Math.PI/180,a=anime.random(50,180),n=[-1,1][anime.random(0,1)]*a;return{x:e.x+n*Math.cos(t),y:e.y+n*Math.sin(t)}}function createParticule(e,t){var a={};return a.x=e,a.y=t,a.color=colors[anime.random(0,colors.length-1)],a.radius=anime.random(16,32),a.endPos=setParticuleDirection(a),a.draw=function(){ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,0,2*Math.PI,!0),ctx.fillStyle=a.color,ctx.fill()},a}function createCircle(e,t){var a={};return a.x=e,a.y=t,a.color="#F00",a.radius=0.1,a.alpha=0.5,a.lineWidth=6,a.draw=function(){ctx.globalAlpha=a.alpha,ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,0,2*Math.PI,!0),ctx.lineWidth=a.lineWidth,ctx.strokeStyle=a.color,ctx.stroke(),ctx.globalAlpha=1},a}function renderParticule(e){for(var t=0;t<e.animatables.length;t++){e.animatables[t].target.draw()}}function animateParticules(e,t){for(var a=createCircle(e,t),n=[],i=0;i<numberOfParticules;i++){n.push(createParticule(e,t))}anime.timeline().add({targets:n,x:function(e){return e.endPos.x},y:function(e){return e.endPos.y},radius:0.1,duration:anime.random(1200,1800),easing:"easeOutExpo",update:renderParticule}).add({targets:a,radius:anime.random(80,160),lineWidth:0,alpha:{value:0,easing:"linear",duration:anime.random(600,800)},duration:anime.random(1200,1800),easing:"easeOutExpo",update:renderParticule,offset:0})}function debounce(e,t){var a;return function(){var n=this,i=arguments;clearTimeout(a),a=setTimeout(function(){e.apply(n,i)},t)}}var canvasEl=document.querySelector(".fireworks");if(canvasEl){var ctx=canvasEl.getContext("2d"),numberOfParticules=30,pointerX=0,pointerY=0,tap="mousedown",colors=["#FF1461","#18FF92","#5A87FF","#FBF38C"],setCanvasSize=debounce(function(){canvasEl.width=2*window.innerWidth,canvasEl.height=2*window.innerHeight,canvasEl.style.width=window.innerWidth+"px",canvasEl.style.height=window.innerHeight+"px",canvasEl.getContext("2d").scale(2,2)},500),render=anime({duration:1/0,update:function(){ctx.clearRect(0,0,canvasEl.width,canvasEl.height)}});document.addEventListener(tap,function(e){"sidebar"!==e.target.id&&"toggle-sidebar"!==e.target.id&&"A"!==e.target.nodeName&&"IMG"!==e.target.nodeName&&(render.play(),updateCoords(e),animateParticules(pointerX,pointerY))},!1),setCanvasSize(),window.addEventListener("resize",setCanvasSize,!1)}"use strict";function updateCoords(e){pointerX=(e.clientX||e.touches[0].clientX)-canvasEl.getBoundingClientRect().left,pointerY=e.clientY||e.touches[0].clientY-canvasEl.getBoundingClientRect().top}function setParticuleDirection(e){var t=anime.random(0,360)*Math.PI/180,a=anime.random(50,180),n=[-1,1][anime.random(0,1)]*a;return{x:e.x+n*Math.cos(t),y:e.y+n*Math.sin(t)}}function createParticule(e,t){var a={};return a.x=e,a.y=t,a.color=colors[anime.random(0,colors.length-1)],a.radius=anime.random(16,32),a.endPos=setParticuleDirection(a),a.draw=function(){ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,0,2*Math.PI,!0),ctx.fillStyle=a.color,ctx.fill()},a}function createCircle(e,t){var a={};return a.x=e,a.y=t,a.color="#F00",a.radius=0.1,a.alpha=0.5,a.lineWidth=6,a.draw=function(){ctx.globalAlpha=a.alpha,ctx.beginPath(),ctx.arc(a.x,a.y,a.radius,0,2*Math.PI,!0),ctx.lineWidth=a.lineWidth,ctx.strokeStyle=a.color,ctx.stroke(),ctx.globalAlpha=1},a}function renderParticule(e){for(var t=0;t<e.animatables.length;t++){e.animatables[t].target.draw()}}function animateParticules(e,t){for(var a=createCircle(e,t),n=[],i=0;i<numberOfParticules;i++){n.push(createParticule(e,t))}anime.timeline().add({targets:n,x:function(e){return e.endPos.x},y:function(e){return e.endPos.y},radius:0.1,duration:anime.random(1200,1800),easing:"easeOutExpo",update:renderParticule}).add({targets:a,radius:anime.random(80,160),lineWidth:0,alpha:{value:0,easing:"linear",duration:anime.random(600,800)},duration:anime.random(1200,1800),easing:"easeOutExpo",update:renderParticule,offset:0})}function debounce(e,t){var a;return function(){var n=this,i=arguments;clearTimeout(a),a=setTimeout(function(){e.apply(n,i)},t)}}var canvasEl=document.querySelector(".fireworks");if(canvasEl){var ctx=canvasEl.getContext("2d"),numberOfParticules=30,pointerX=0,pointerY=0,tap="mousedown",colors=["#FF1461","#18FF92","#5A87FF","#FBF38C"],setCanvasSize=debounce(function(){canvasEl.width=2*window.innerWidth,canvasEl.height=2*window.innerHeight,canvasEl.style.width=window.innerWidth+"px",canvasEl.style.height=window.innerHeight+"px",canvasEl.getContext("2d").scale(2,2)},500),render=anime({duration:1/0,update:function(){ctx.clearRect(0,0,canvasEl.width,canvasEl.height)}});document.addEventListener(tap,function(e){"sidebar"!==e.target.id&&"toggle-sidebar"!==e.target.id&&"A"!==e.target.nodeName&&"IMG"!==e.target.nodeName&&(render.play(),updateCoords(e),animateParticules(pointerX,pointerY))},!1),setCanvasSize(),window.addEventListener("resize",setCanvasSize,!1)};

② 打开themes/next/layout/_layout.swig,在</body>上面写下如下代码:
QQ截图20200829123448.jpg

  <!-- 添加点击特效 -->
  {% if theme.fireworks %}
   <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;" ></canvas> 
   <script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script> 
   <script type="text/javascript" src="/js/schemes/fireworks.js"></script>
  {% endif %}

QQ截图20200829123613.jpg

③ 打开主题配置文件,在里面最后写下:

# Fireworks
fireworks: true

效果如下:
QQ截图20200829123147.jpg

在右上角或者左上角实现fork me on github

方式一:手动添加

① 找到对应模板,复制代码
可以点击此网站,任意选择一个样式https://tholman.com/github-corners/

② 复制到对应目录下,更改代码中的github即可
目录如下:
QQ截图20200902183836.jpg
说明:找到

这个标签,将代码放在下方并更改url即可。
20200902184123.png

效果如下:
QQ截图20200902184120.jpg


方式二:直接在next主题配置文件中设置

# `Follow me on GitHub` banner in the top-right corner.
github_banner:
  enable: true
  permalink: https://github.com/changlua/changlua.github.io
  title: Follow me on GitHub

效果展示:
image.png


添加rss

① 对应博客目录下安装插件

npm install --save hexo-generator-feed

image.png

解决方案:更新 npm 版本即可,执行如下命令:npm i npm -g
image.png 进行更新

再次执行安装插件命令:
image.png
出现了两个错误报错
原因: fsevent是mac osx系统的,在win或者Linux下使用了 所以会有警告,忽略就好了,意思就是你已经安装成功了,之后npm run dev即可


② 在Hexo目录下的_config.yml文件中添加一下代码:

feed:
  type: atom
  path: atom.xml
  limit: 20
  hub:
  content:
  content_limit: 140
  content_limit_delim: " "
  order_by: -date
  icon: icon.png

③ 配置Hexo目录下的配置文件
添加url地址,如下:
image.png


④ 修改next目录下的配置文件

方式一:在next的配置文件下的follow_me打开其中的rss

image.png

效果:每篇文章最后会出现RSS效果
image.png

方式二:在next目录的配置文件中的scoial下添加rss

image.png
效果:
image.png


⑤ 重新部署启动即可
hexo clean && hexo g && hexo s


在网站底部添加访问量

相关文章:
页脚添加访客人数方式(两种):https://www.jianshu.com/p/c311d31265e0
原作者网站(也有相关教程):http://ibruce.info/2015/04/04/busuanzi/

① 找到next目录下的位置,如下:
QQ截图20200902194341.jpg

② 对应位置添加两条内容:
第一条:js引用
由于原作者域名更改所以这里已经进行了替换

<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

QQ截图20200902194707.jpg


第二条:进行数据统计显示(这里是使用一种方式计算)**

  <div class="powered-by">
    <i class="fa fa-user-md"></i>
    <span id="busuanzi_container_site_uv">
      本站访客数<span id="busuanzi_value_site_uv"></span>人次
    </span>
  </div>

QQ截图20200902211908.jpg


在这里有两中不同计算方式的统计代码:

  1. pv的方式,单个用户连续点击n篇文章,记录n次访问量

    <span id="busuanzi_container_site_pv">
     本站总访问量<span id="busuanzi_value_site_pv"></span>次
    </span>
    
  2. uv的方式,单个用户连续点击n篇文章,只记录1次访客数

    <span id="busuanzi_container_site_uv">
    本站总访问量<span id="busuanzi_value_site_uv"></span>次
    </span>
    

效果显示:
QQ截图20200902212514.jpg

添加 README.md 文件

QQ截图20200902214610.jpg

隐藏网页底部powered By Hexo / 强力驱动

QQ截图20200902220755.jpg

友情链接

在next主题下的配置文件中:
image.png
上面的settings是设置,其中layout是一行行展开,下面links是对应的链接。

增加留言栏(暂未)

① 注册leancloud

https://leancloud.cn/

image.png
进行实名认证
image.png

② 创建应用

image.png
image.png

③ 获取APPID以及AppKey,添加到主题配置文件中去

image.png

# Valine
# For more information: https://valine.js.org, https://github.com/xCss/Valine
valine:
  enable: true
  appId: your appId
  appKey: your appKey
  placeholder: ヾノ≧∀≦)o快来,快来! # Comment box placeholder
  avatar: mm # Gravatar style
  meta: [nick, mail, link] # Custom comment header
  pageSize: 10 # Pagination size
  language: # Language, available values: en, zh-cn
  visitor: false # Article reading statistic
  comment_count: true # If false, comment count will only be displayed in post page, not in home page
  recordIP: false # Whether to record the commenter IP
  serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in)
  enableQQ: false # Whether to enable the Nickname box to automatically get QQ Nickname and QQ Avatar
  requiredFields: [] # Set required fields: ['nick'] | ['nick','mail']
  #post_meta_order: 0

④ leancloud的安全中心的web安全域名添加即可

image.png

效果展示:
image.png


点击头像跳转到对应页面

目录下:themes\next\layout_partials\sidebar\site-overview.njk

增加一个标签即可:
image.png

效果展示:
GIF.gif


第三方服务

百度统计

QQ截图20200827152438.jpg
具体步骤如下:
① 首先需要登录:https://tongji.baidu.com/web/10000260515/welcome/login
② 登录之后选择代码管理—代码
QQ截图20200827152619.jpg 之后进行新增网页,将你的网站输入即可
③ 复制教程后的id到你的主题配置文件中的baidu_analytics: xxx 即可


整理者:长路 时间:2020/8/27
**