有一些东西,用过不久就遗忘了,等在使用的时候,再各种去翻资料,再加上国内的搜索环境,所以要留下有点脚印。

认识 Hexo

Hexo 使用 node.js 编写,生成静态网页的速度也很迅速。

支持 Markdown 渲染,部署方便,可以一条指令部署到 Github pages 等平台。

插件丰富+中文文档,也降低入门的门槛。

必备技能

  • node.js 基础知识
  • Git 基础知识
  • Markdown 基本知识
  • 网页前端、css、JavaScript 等知识
  • npm install 和 uninstall
  • ……

看到这里,你不要被吓到关闭页面。除了 Markdown,其他都可以不用熟练掌握,有空也可以学习一下(Markdown 是必备技能,文章的排版插图都需要,但是还是要好好复习一下)。

安装 Hexo

在安装之前,你需要安装以下两个软件:

如果已经安装好以上工具,可以直接跳过,往下看。

安装 Git

  • Windows:下载并安装 git
  • Mac:使用 Homebrew, MacPorts 或者下载 安装程序
  • Linux (Ubuntu, Debian):sudo apt-get install git-core
  • Linux (Fedora, Red Hat, CentOS):sudo yum install git-core
  • Linux (Arch 系列): sudo pacman -S git

Mac 用户如果在编译时可能会遇到问题,请先到 App Store 安装 Xcode,Xcode 完成后,启动并进入 Preferences -> Download -> Command Line Tools -> Install 安装命令行工具。

Windows 用户对于中国大陆地区用户,可以前往 淘宝 Git for Windows 镜像 下载 git 安装包。

安装 Node.js

Node.js 为大多数平台提供了官方的 安装程序。对于中国大陆地区用户,可以前往 淘宝 Node.js 镜像 下载。

其它的安装方法:

  • Windows:通过 nvs(推荐)或者 nvm 安装。
  • Mac:使用 HomebrewMacPorts 安装。
  • Linux(DEB/RPM-based):从 NodeSource 安装。
  • 其它:使用相应的软件包管理器进行安装,可以参考由 Node.js 提供的 指导

切换 npm 为淘宝 npm 镜像

国内的网络环境不是很好,访问外网的速度不是理想的时候,可以进行切换,提高下载速度。

Git bash命令行进行切换,如果遇到权限问题,请使用管理员身份运行。

1
2
3
4
5
6
7
8
# 全局替换命令
npm config set registry http://registry.npm.taobao.org/

# 查看版本
npm get registry

# 切换官方命令
npm config set registry http://www.npmjs.org

安装 Hexo 程序

Git bash Here 命令行

输入官方安装命令

1
npm install hexo-cli -g

看看安装版本

1
hexo v

创建 hexo 目录

这个目录是存放主题、运行文件、写的博文、生成的静态网站文件等等都在这里完成。

在指定的文件夹,选择 Git Bash Here 输入指令

1
2
# 建立你的网站根目录,名字自己修改一下
mkdir <blog_name>

然后往这个文件夹里面,初始化 hexo。

1
hexo init <blog_name>

安装主题

默认的主题应该没有什么人使用吧?换一个赏心悦目一下!

这里使用安知鱼的 hexo 主题,就是本站的主题一样,其他主题切换的方法也是差不多的。

Git Bash 里面输入获取主题的 GitHub 地址,并安装到 themes目录

1
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu

安装主题后,要进行主题的运用,修改安装目录下 _config.yml配置文件,修改成刚刚下载主题的名称。

1
2
# 修改为主题的名称
theme: anzhiyu

安装 pug 和 stylus 渲染插件

这里是安知鱼主题的需要的应用拓展的,安装一下。

1
npm install hexo-renderer-pug hexo-renderer-stylus --save

配置网站信息

网站相关信息

在安装文件夹 _config.yml 这个文件里配置!更多配置可以看一下官方文档。

1
2
3
4
5
6
7
title:
subtitle:
description:
keywords:
author:
language:
timezone:
参数描述
title网站标题
subtitle网站副标题
description网站描述
keywords网站关键词
author作者名字
language网站使用的语言
timezone网站时区:详见时区列表

更多的文档资料请查看Hexo 官方文档

Hexo 相关命令

hexo init [name]

这个是 hexo 的初始化命令,[name]代表你要初始化的目录路径,hexo init是初始化当前文件夹

hexo new [layout]</h3><figure class="highlight gauss"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo <span class="keyword">new</span> [layout] <<span class="built_in">title</span>></span><br></pre></td></tr></table></figure> <p>这个命令是新建文章或页面用的命令。其中 <code>[layout]</code> 表示他的模板(即页面或者文章), <code><title></code> 表示标题。</p> <table> <thead> <tr> <th>布局</th> <th>路径</th> <th>详解</th> </tr> </thead> <tbody><tr> <td><code>post</code></td> <td><code>source/_posts</code></td> <td>文章页面</td> </tr> <tr> <td><code>page</code></td> <td><code>source</code></td> <td>页面页面</td> </tr> </tbody></table> <p><code>hexo new post hello</code>,表示在 <code>_posts</code>创建了一篇为 <code>hello</code>的文章</p> <h3 id="hexo-server"><a href="#hexo-server" class="headerlink" title="hexo server"></a>hexo server</h3><p>当你你想浏览本地生成网站的时候,使用这个命令。</p> <p>命令可以简写为 <code>hexo s</code></p> <p>默认地址为 <code>http://localhost:4000</code> 如果想修改端口号,可以在 <code>Git Bash</code> 输入 <code>hexo s -p 端口</code></p> <h3 id="hexo-generate"><a href="#hexo-generate" class="headerlink" title="hexo generate"></a>hexo generate</h3><p>这个命令是生成网站静态文件的时候用的,生成后网页将会放在根目录下面的 <code>public</code> 文件夹里。</p> <p>命令也可以简写为 <code>hexo g</code></p> <h3 id="hexo-clean"><a href="#hexo-clean" class="headerlink" title="hexo clean"></a>hexo clean</h3><p>这个命令用来清空 <code>public</code> 文件夹。</p> <p>命令可以简写为 <code>hexo cl</code></p> <h3 id="hexo-deploy"><a href="#hexo-deploy" class="headerlink" title="hexo deploy"></a>hexo deploy</h3><p>这个命令用来部署网站,使用此命令将会把生成好的页面(即 <code>public</code> 文件夹里的内容)部署到指定的地方上。</p> <p>命令可以简写为 <code>hexo d</code></p> <h3 id="hexo-versio"><a href="#hexo-versio" class="headerlink" title="hexo versio"></a>hexo versio</h3><p>这个命令用来输出你所使用的 Hexo 目前的版本号。</p> <h3 id="一键本地预览"><a href="#一键本地预览" class="headerlink" title="一键本地预览"></a>一键本地预览</h3><p>清理本地<code>public</code>文件夹,重新生成静态文件到<code>public</code>,运行本地代理服务器</p> <figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">hexo cl</span><br><span class="line">hexo g</span><br><span class="line">hexo s</span><br><span class="line"></span><br><span class="line"><span class="meta"># 也可以这样</span></span><br><span class="line">hexo cl <span class="meta">&& hexo g && hexo s</span></span><br></pre></td></tr></table></figure> </article><div class="post-copyright"><div class="post-copyright__author_group"><a class="post-copyright__author_img" href="/about/"><img class="post-copyright__author_img_front" src="/img/favicon.ico"></a><div class="post-copyright__author_name">钧言极客</div><div class="post-copyright__author_desc">记录生活,爱好学习,不爱折腾</div></div><div class="post-tools" id="post-tools"><div class="post-tools-left"><div id="quit-box" onclick="RemoveRewardMask()"></div></div></div><div class="post-copyright__notice"><span class="post-copyright-info">本文是原创文章,采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a>协议,完整转载请注明来自<a href="/">钧言极客</a></span></div></div><div class="post-tools-right"><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E6%95%99%E7%A8%8B/"><span class="tags-punctuation"><i class="solitude fa-solid fa-hashtag"></i>教程<span class="tagsPageCount">61</span></span></a><a class="post-meta__tags" href="/tags/Git/"><span class="tags-punctuation"><i class="solitude fa-solid fa-hashtag"></i>Git<span class="tagsPageCount">7</span></span></a><a class="post-meta__tags" href="/tags/Hexo/"><span class="tags-punctuation"><i class="solitude fa-solid fa-hashtag"></i>Hexo<span class="tagsPageCount">7</span></span></a></div></div></div><nav class="needEndHide pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/70.html"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Hexo 部署 Github Pages</div></div></a></div><div class="next-post pull-right"><a href="/posts/68.html"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">浏览器原生img懒加载方案 - Lazy loading</div></div></a></div></nav> <div class="relatedPosts"> <div class="headline"> <i class="solitude fa-solid fa-star"></i> <span>喜欢这篇的人也看了</span> <div class="relatedPosts-link"> <a onclick="event.preventDefault(); toRandomPost();" href="javascript:void(0);" rel="external nofollow" data-pjax-state="">随便逛逛</a> </div> </div> <div class="relatedPosts-list"> <div> <a href="/posts/89.html" title="Gitea Actions Runner 自定义images镜像"> <img class="cover" src="https://img.jinjun.top/images/2023/11/13/1811b243784db5f1e65d579688350299.png" alt="cover"> <div class="content is-center"> <div class="title">Gitea Actions Runner 自定义images镜像</div> </div> </a> </div> <div> <a href="/posts/80.html" title="华为云CodeArts流水线托管Hexo"> <img class="cover" src="https://img.jinjun.top/images/2024/06/07/b000c31f442ab94fcb3b33d0a0ea76c9.png" alt="cover"> <div class="content is-center"> <div class="title">华为云CodeArts流水线托管Hexo</div> </div> </a> </div> </div> </div><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="solitude fa-solid fa-comment"></i><span> 评论</span><span class="count"> (<span class="twikoo-count"><i class="solitude fa-solid fa-spinner fa-spin"></i></span>)</span></div></div><div class="comment-wrap"><div id="twikoo-wrap"></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><div class="author-info__top-group"><div class="author-info__sayhi" id="author-info__sayhi" onclick="sco.changeSayHelloText()">sayhello.morning</div></div></div><div class="avatar-img-group"><img class="avatar-img" alt="头像" src="/img/siteicon/manifest-icon-192.maskable.png"></div><div class="author-info__description_group"><div class="author-info__description"></div><div class="author-info__description2"></div></div><div class="author-info__bottom-group"><a class="author-info__bottom-group-left" href="/about/"><div class="author-info__name">钧言</div><div class="author-info__desc">记录生活,爱好学习,不爱折腾</div></a><div class="card-info-social-icons is-center"></div></div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="solitude fa-solid fa-bars"></i><span>文章目录</span></div><div class="toc-content" id="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AE%A4%E8%AF%86-Hexo"><span class="toc-text">认识 Hexo</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BF%85%E5%A4%87%E6%8A%80%E8%83%BD"><span class="toc-text">必备技能</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Hexo"><span class="toc-text">安装 Hexo</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Git"><span class="toc-text">安装 Git</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Node-js"><span class="toc-text">安装 Node.js</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%87%E6%8D%A2-npm-%E4%B8%BA%E6%B7%98%E5%AE%9D-npm-%E9%95%9C%E5%83%8F"><span class="toc-text">切换 npm 为淘宝 npm 镜像</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Hexo-%E7%A8%8B%E5%BA%8F"><span class="toc-text">安装 Hexo 程序</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-hexo-%E7%9B%AE%E5%BD%95"><span class="toc-text">创建 hexo 目录</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E4%B8%BB%E9%A2%98"><span class="toc-text">安装主题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-pug-%E5%92%8C-stylus-%E6%B8%B2%E6%9F%93%E6%8F%92%E4%BB%B6"><span class="toc-text">安装 pug 和 stylus 渲染插件</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E7%BD%91%E7%AB%99%E4%BF%A1%E6%81%AF"><span class="toc-text">配置网站信息</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E7%9B%B8%E5%85%B3%E4%BF%A1%E6%81%AF"><span class="toc-text">网站相关信息</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E7%9B%B8%E5%85%B3%E5%91%BD%E4%BB%A4"><span class="toc-text">Hexo 相关命令</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#hexo-init-name"><span class="toc-text">hexo init [name]</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#hexo-new-layout"><span class="toc-text">hexo new [layout] </h3><figure class="highlight gauss"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo <span class="keyword">new</span> [layout] <<span class="built_in">title</span>></span><br></pre></td></tr></table></figure> <p>这个命令是新建文章或页面用的命令。其中 <code>[layout]</code> 表示他的模板(即页面或者文章), <code><title></code> 表示标题。</p> <table> <thead> <tr> <th>布局</th> <th>路径</th> <th>详解</th> </tr> </thead> <tbody><tr> <td><code>post</code></td> <td><code>source/_posts</code></td> <td>文章页面</td> </tr> <tr> <td><code>page</code></td> <td><code>source</code></td> <td>页面页面</td> </tr> </tbody></table> <p><code>hexo new post hello</code>,表示在 <code>_posts</code>创建了一篇为 <code>hello</code>的文章</p> <h3 id="hexo-server"><a href="#hexo-server" class="headerlink" title="hexo server"></a>hexo server</h3><p>当你你想浏览本地生成网站的时候,使用这个命令。</p> <p>命令可以简写为 <code>hexo s</code></p> <p>默认地址为 <code>http://localhost:4000</code> 如果想修改端口号,可以在 <code>Git Bash</code> 输入 <code>hexo s -p 端口</code></p> <h3 id="hexo-generate"><a href="#hexo-generate" class="headerlink" title="hexo generate"></a>hexo generate</h3><p>这个命令是生成网站静态文件的时候用的,生成后网页将会放在根目录下面的 <code>public</code> 文件夹里。</p> <p>命令也可以简写为 <code>hexo g</code></p> <h3 id="hexo-clean"><a href="#hexo-clean" class="headerlink" title="hexo clean"></a>hexo clean</h3><p>这个命令用来清空 <code>public</code> 文件夹。</p> <p>命令可以简写为 <code>hexo cl</code></p> <h3 id="hexo-deploy"><a href="#hexo-deploy" class="headerlink" title="hexo deploy"></a>hexo deploy</h3><p>这个命令用来部署网站,使用此命令将会把生成好的页面(即 <code>public</code> 文件夹里的内容)部署到指定的地方上。</p> <p>命令可以简写为 <code>hexo d</code></p> <h3 id="hexo-versio"><a href="#hexo-versio" class="headerlink" title="hexo versio"></a>hexo versio</h3><p>这个命令用来输出你所使用的 Hexo 目前的版本号。</p> <h3 id="一键本地预览"><a href="#一键本地预览" class="headerlink" title="一键本地预览"></a>一键本地预览</h3><p>清理本地<code>public</code>文件夹,重新生成静态文件到<code>public</code>,运行本地代理服务器</p> <figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">hexo cl</span><br><span class="line">hexo g</span><br><span class="line">hexo s</span><br><span class="line"></span><br><span class="line"><span class="meta"># 也可以这样</span></span><br><span class="line">hexo cl <span class="meta">&& hexo g && hexo s</span></span><br></pre></td></tr></table></figure> </span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="solitude fa-solid fa-map"></i><span>最近发布</span></div><div class="aside-list"><a class="aside-list-item" href="/posts/89.html" title="Gitea Actions Runner 自定义images镜像"><div class="thumbnail"><img alt="Gitea Actions Runner 自定义images镜像" src="https://img.jinjun.top/images/2023/11/13/1811b243784db5f1e65d579688350299.png"></div><div class="content"><span class="title" href="/posts/89.html" title="Gitea Actions Runner 自定义images镜像">Gitea Actions Runner 自定义images镜像</span><span class="article-recent_post_categories" href="/posts/89.html">折腾日志</span></div></a><a class="aside-list-item" href="/posts/88.html" title="Hexo建站历程备忘"><div class="thumbnail"><img alt="Hexo建站历程备忘" src="https://bu.dusays.com/2024/11/21/673e135584f02.webp"></div><div class="content"><span class="title" href="/posts/88.html" title="Hexo建站历程备忘">Hexo建站历程备忘</span></div></a><a class="aside-list-item" href="/posts/87.html" title="Solitude主题魔改内容"><div class="thumbnail"><img alt="Solitude主题魔改内容" src="https://bu.dusays.com/2024/11/18/673b61cc169b5.webp"></div><div class="content"><span class="title" href="/posts/87.html" title="Solitude主题魔改内容">Solitude主题魔改内容</span></div></a><a class="aside-list-item" href="/posts/86.html" title="Linux目录结构"><div class="thumbnail"><img alt="Linux目录结构" src="https://bu.dusays.com/2024/11/06/672b75f0e83ea.webp"></div><div class="content"><span class="title" href="/posts/86.html" title="Linux目录结构">Linux目录结构</span><span class="article-recent_post_categories" href="/posts/86.html">学习笔记</span></div></a><a class="aside-list-item" href="/posts/85.html" title="全国互联网安全管理服务提交安全评估报告"><div class="thumbnail"><img alt="全国互联网安全管理服务提交安全评估报告" src="https://bu.dusays.com/2024/10/28/671f6aac2cf2f.webp"></div><div class="content"><span class="title" href="/posts/85.html" title="全国互联网安全管理服务提交安全评估报告">全国互联网安全管理服务提交安全评估报告</span><span class="article-recent_post_categories" href="/posts/85.html">生活随笔</span></div></a></div></div></div></div></main><footer id="footer"><div id="st-footer"><div class="footer-group"><h3 class="footer-title">导航</h3><div class="footer-links"><a class="footer-item" href="/essay/" title="即刻">即刻</a><a class="footer-item" href="/archives/" title="归档">归档</a><a class="footer-item" href="/categories/" title="分类">分类</a></div></div><div class="footer-group"><h3 class="footer-title">支持</h3><div class="footer-links"><a class="footer-item" target="_blank" rel="noopener" href="https://www.huaweicloud.com/" title="华为云">华为云</a><a class="footer-item" target="_blank" rel="noopener" href="https://aliyun.com/" title="阿里云">阿里云</a><a class="footer-item" target="_blank" rel="noopener" href="https://solitude.js.org/" title="Solitude">Solitude</a></div></div><div class="footer-group"><h3 class="footer-title">服务</h3><div class="footer-links"><a class="footer-item" target="_blank" rel="noopener" href="https://bf.zzxworld.com/s/1252" title="BlogFinder">BlogFinder</a><a class="footer-item" target="_blank" rel="noopener" href="https://status.boke.fun/" title="服务状态">服务状态</a></div></div><div class="footer-group"><h3 class="footer-title">协议</h3><div class="footer-links"><a class="footer-item" href="/privacy/" title="隐私协议">隐私协议</a><a class="footer-item" href="/cookies/" title="Cookies">Cookies</a><a class="footer-item" href="/copyright/" title="版权协议">版权协议</a><a class="footer-item" href="/atom.xml" title="订阅本站">订阅本站</a></div></div><div class="footer-group"><div class="footer-title-group"><h3 class="footer-title">友链</h3><button class="random-friends-btn" onclick="randomLinksList()" title="友链"><i class="solitude fa-solid fa-arrows-rotate"></i></button></div><div class="footer-links" id="friend-links-in-footer"></div></div></div><div id="footer-animal"><div class="animal-wall"></div><img class="animal entered loaded" src="/img/colore.avif" onerror="this.onerror=null;this.src='/img/thumbnail.svg';" data-lazy-src="/img/colore.avif" alt="动物"></div><div id="footer-bar"><div class="footer-bar-links"><div class="footer-bar-left"><div class="copyright">© 2016 - 2024 By <a class="footer-bar-link" href="/">钧言</a></div></div><div class="footer-bar-right"><a class="footer-bar-link" target="_blank" rel="noopener" href="https://beian.miit.gov.cn/" alt="粤ICP备16101751号">粤ICP备16101751号</a><a class="footer-bar-link" target="_blank" rel="noopener" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44090202000424" alt="粤公网安备44090202000424号">粤公网安备44090202000424号</a></div></div></div><div class="comment-barrage needEndHide"></div></footer></div><!-- right_menu--><!-- inject body--><div><script src="/js/utils.js?v=2.1.8"></script><script src="/js/main.js?v=2.1.8"></script><script src="/js/third_party/waterfall.min.js?v=2.1.8"></script><script src="//s4.zstatic.net/ajax/libs/pjax/0.2.8/pjax.min.js"></script><script src="/js/third_party/universe.min.js?v=2.1.8"></script><script>dark() </script><script src="//s4.zstatic.net/ajax/libs/vanilla-lazyload/19.1.3/lazyload.iife.min.js"></script><script src="//s4.zstatic.net/ajax/libs/node-snackbar/0.1.16/snackbar.min.js"></script><script src="//s4.zstatic.net/ajax/libs/medium-zoom/1.1.0/medium-zoom.min.js"></script><script src="//s4.zstatic.net/ajax/libs/Swiper/11.0.5/swiper-bundle.min.js"></script><script>var meting_api = 'https://meting.everfu.cn/?server=:server&type=:type&id=:id&auth=:auth&r=:r';</script><script src="//s4.zstatic.net/ajax/libs/aplayer/1.10.1/APlayer.min.js"></script><script src="//s4.zstatic.net/ajax/libs/meting/2.0.1/Meting.min.js"></script><script>const coverColorConfig = { api: 'https://api.qjqq.cn/api/Imgcolor?img=', time: 43200000 }</script><script src="/js/covercolor/api.js?v=2.1.8"></script><script src="//s4.zstatic.net/ajax/libs/pace/1.2.4/pace.min.js"></script><script src="//s4.zstatic.net/ajax/libs/instantsearch.js/4.75.5/instantsearch.production.min.js"></script><script src="//s4.zstatic.net/ajax/libs/algoliasearch/5.14.2/algoliasearch.umd.min.js"></script><script src="/config/js/calendar.js"></script><script src="/config/js/chinese-lunar.js"></script><link rel="stylesheet" href="/config/css/calendar.css"><script src="/config/js/default.js"></script><div class="js-pjax"><script>(() => { const getCount = () => { const ele = document.querySelectorAll('.twikoo-count') if (!ele) return twikoo.getCommentsCount({ envId: 'https://pla.boke.fun/', region: '', urls: [window.location.pathname], includeReply: false }).then(res => { ele.forEach(item => item.textContent = res[0].count) }).catch(err => { console.error(err) }) } const init = () => { twikoo.init(Object.assign({ el: '#twikoo-wrap', envId: 'https://pla.boke.fun/', region: '', path: window.location.pathname, onCommentLoaded: () => { GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)')) const processLinks = () => { const container = document.querySelector('#twikoo .tk-comments-container'); if (!container) return; const links = container.querySelectorAll('a'); links.forEach((link) => { const href = link.getAttribute('href'); if (!href) return; if (!href.startsWith(window.location.origin) && !link.hasAttribute('data-fancybox')) { const encodedHref = btoa(href); const newHref = `/go.html?u=${encodedHref}`; link.setAttribute('href', newHref); link.setAttribute('rel', 'external nofollow noopener noreferrer'); link.setAttribute('target', '_blank'); } }); }; processLinks(); } }, null)) && getCount() sco.owoBig({ body: '.OwO-body', item: '.OwO-items li' }) true && barrageTwikoo() } const loadTwikoo = () => { if (typeof twikoo === 'object') setTimeout(init,0) else utils.getScript('//s4.zstatic.net/ajax/libs/twikoo/1.6.40/twikoo.all.min.js').then(init) } if ('Twikoo' === 'Twikoo' || false) { if (false) utils.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo) else loadTwikoo() } else { window.loadTwoComment = loadTwikoo } })() </script><script>async function barrageTwikoo() { await fetch("https://pla.boke.fun/", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ event: "COMMENT_GET", accessToken: "", url: window.location.pathname }) }).then(async res => { if (!res.ok) throw new Error("HTTP error! status: " + res.status) const data = await res.json(); const init = () => { initializeCommentBarrage((data.data).map(item => Object.assign({ content: item.comment, nick: item.nick, mailMd5: item.mailMd5, id: item.id }))) } if (typeof initializeCommentBarrage === "undefined") await utils.getScript('/js/third_party/barrage.min.js?v=2.1.8').then(init) else init() }).catch(error => console.error("An error occurred while fetching comments: ", error)) }</script></div></div><script>const links = [{"name":"钧言极客","link":"https://www.jinjun.top/"},{"name":"钧言极客","link":"https://www.jinjun.top"},{"name":"极客乐趣","link":"https://www.boke.fun"},{"name":"心语难诉","link":"https://xinyu19.com"},{"name":"小俊博客","link":"https://www.smalljun.com"},{"name":"peachRL的小站","link":"https://wanyijizi.com"},{"name":"团团生活志","link":"https://t-t.live/"},{"name":"热爱生活","link":"https://www.clcou.com"},{"name":"城南旧事","link":"https://rzi.me/"},{"name":"目的地-Destination","link":"https://chrison.cn/"},{"name":"风记星辰","link":"https://www.thyuu.com/"},{"name":"荒野孤灯","link":"https://www.80srz.com"},{"name":"懋和道人","link":"https://www.dao.js.cn/"},{"name":"倾城于你","link":"https://qninq.cn/"},{"name":"iNetech Blog","link":"https://blog.inetech.fun"},{"name":"颔首的博客","link":"https://www.38blog.com"},{"name":"阿飞博客","link":"https://blog.afly.me"},{"name":"十三的小站","link":"https://www.123bk.cn/"},{"name":"Crant","link":"https://www.crant.cn/"},{"name":"柒柒blog","link":"https://blog.lwgzs.cn/"},{"name":"三叶草蝶","link":"https://blog.xxzz.net"},{"name":"青桔气球","link":"https://blog.qjqq.cn/"},{"name":"梦爱吃鱼","link":"https://blog.bsgun.cn/"},{"name":"Spark’s Blog","link":"https://www.aspark.cc"},{"name":"一粒微尘","link":"https://blog.667408.xyz"},{"name":"弈鸣小筑","link":"https://blog.lwtools.site"},{"name":"葱苓sama","link":"https://blog.ciraos.top"},{"name":"胜天半子","link":"https://blog.291055.xyz/"},{"name":"XingJiのBlog","link":"https://love.xingji.fun/"},{"name":"云端日志","link":"https://57767.top"},{"name":"❖星港◎Star☆","link":"https://blog.starsharbor.com"},{"name":"蒙需","link":"https://jiangcl.com/"},{"name":"叶泯希","link":"https://ymxblog.us.kg"},{"name":"伍十七","link":"https://blog.everfu.cn"},{"name":"LogDict","link":"https://www.logdict.com"},{"name":"陵长镜","link":"https://r1n.top"},{"name":"清羽飞扬","link":"https://blog.liushen.fun/"},{"name":"十年之约","link":"https://www.foreverblog.cn/"},{"name":"博友圈","link":"https://www.boyouquan.com/home"},{"name":"中文博客列表","link":"https://zhblogs.ohyee.cc/"},{"name":"开往","link":"https://www.travellings.cn/go.html"}] const randomText = '点击前往按钮进入随机一个友链,不保证跳转网站的安全性和可用性。本次随机到的是本站友链:⌈ ${name} ⌋' function travelling() { const link = links[utils.randomNum(links.length)]; Snackbar.show({ text: randomText.replace(/\$\{name}/,link.name), duration: 8000, pos: 'top-center', actionText: '前往', onActionClick: function(element) { element.style.opacity = 0; window.open(link.link, '_blank'); } }); } </script><script>function randomLinksList() { const linkcard = document.getElementById('friend-links-in-footer'); if (linkcard == null) return; let data = ''; let linksCopy = [...links]; let count = Math.min(3, linksCopy.length); for (let i = 0; i < count; i++) { let index = utils.randomNum(linksCopy.length); const {link, name} = linksCopy[index]; data += `<a class="footer-item" href="${link}" target="_blank" rel="noopener noreferrer nofollow">${name}</a>`; linksCopy.splice(index, 1); } linkcard.innerHTML = data + '<a class="footer-item" href="/links/">更多</a>'; }</script><!-- pjax--><script>const pjax = new Pjax({ elements: 'a:not([target="_blank"])', selectors: ["title","#body-wrap","#site-config","meta[name=\"description\"]",".js-pjax","meta[property^=\"og:\"]","#config-diff",".rs_show",".rs_hide"], cacheBust: false, analytics: false, scrollRestoration: false }) document.querySelectorAll('script[data-pjax]').forEach(item => { const newScript = document.createElement('script') const content = item.text || item.textContent || item.innerHTML || "" Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value)) newScript.appendChild(document.createTextNode(content)) item.parentNode.replaceChild(newScript, item) }) document.addEventListener('pjax:complete', () => { window.refreshFn() document.querySelectorAll('script[data-pjax]').forEach(item => { const newScript = document.createElement('script') const content = item.text || item.textContent || item.innerHTML || "" Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value)) newScript.appendChild(document.createTextNode(content)) item.parentNode.replaceChild(newScript, item) }) GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update() }) document.addEventListener('pjax:error', (e) => { if (e.request.status === 404) { pjax.loadUrl('/404.html') } })</script><!-- google adsense--><!-- search--><div id="algolia-search"><div class="search-dialog"><div class="algolia-navbar"><div class="search-dialog__title" id="algolia-search-title">搜索</div><div class="algolia-tips"><i class="solitude fab fa-algolia"></i><span class="algolia-tips-text">Algolia</span></div><span class="search-close-button"><i class="solitude fa-solid fa-xmark"></i></span></div><div id="algolia-input-panel"><div id="algolia-search-input"></div></div><div id="search-results"><div id="algolia-hits"><a class="tag-list" href="javascript:void(0);" onclick="pjax.loadUrl('/tags/Hexo/')">Hexo</a></div></div><div id="algolia-tips"><div id="algolia-pagination"></div><div id="algolia-stats"></div></div></div><div id="search-mask"></div></div><script src="/js/search/algolia.js?v=2.1.8"></script><!-- Tianli-Talk--><!-- music--><div class="needEndHide" id="nav-music"><div id="nav-music-hoverTips" onclick="sco.musicToggle()">音乐已暂停</div><meting-js id="2536288805" server="netease" type="playlist" mutex="true" preload="none" theme="var(--efu-main)" data-lrctype="0" order="random" volume="0.5"></meting-js></div></body></html>