
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick Start
Create a new post
1 | $ hexo new "My New Post" |
More info: Writing
Run server
1 | $ hexo server |
More info: Server
Generate static files
1 | $ hexo generate |
More info: Generating
Deploy to remote sites
1 | $ hexo deploy |
More info: Deployment
相关推荐

2022-07-20
Butterffly 分类页和标签页隐藏侧栏
前言 2022-08-04 更新文章 butterfly4.3.0 版本已增加 tag 和 category 页面可隐藏 aside,但不能隐藏某个 标签 或 分类 的侧边栏。 本文教程主要针对 Hexo Butterfly 主题博客,当用户进入归档、分类、标签页面时,已经是有目的性地浏览文章,此时可以隐藏侧边栏,避免 归档、分类、标签 信息的重复显示,_config.butterfly.yml 配置文件已经有了 归档页 的设置项了,我们需要加上 分类页 和 标签页 的设置项,修改主题源码。 修改主题配置文件butterfly4.2.2butterfly4.3.0打开 _config.butterfly.yml 文件,找到 aside 配置项,添加 分类页 和 标签页 是否显示侧栏的设置项。 123456789101112 aside: enable: true hide: false button: true mobile: true # display on mobile position: right # left or right ...

2022-09-13
Butterfly Twikoo 评论热评
前言本文教程主要针对 Hexo Butterfly 主题博客中的 Twikoo 评论,按本文逻辑或许可以获取其他类型的评论,本文不作探讨。 看了其他小伙伴的 评论热评教程,觉得有点复杂,于是自己想了一个方法来实现这个功能。 沿用其他模块中用到的 swiper 轮播 使用本地缓存保存 隐藏或显示 热评,刷新或切换页面时仍 隐藏或显示 热评 增加评论的城市和日期 页面提交评论后会立即更新热评数据 点击 头像 可访问网站 点击 热评 可跳转至评论区 点击 评论内容 可跳转至改评论 此功能需关闭评论的懒加载 _config.butterfly.yml => comments.lazyload: false,否则需等页面活动至评论区才会加载。 1234567891011comments: # Up to two comments system, the first will be shown as default # Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook...

2022-05-23
Butterfly 分类标签导航栏
前言本文用于 butterfly 魔改,博主没有测试是否适配于其他主题,以及自定义样式 CSS 可能需要一定的前端知识进行优化。 2022-08-15 适配多分类文章,优化代码 2022-08-16 当分类/标签较多时,导航栏会滚动至当前页面高亮标签。 2023-03-21 修复分类/标签翻页导致无法定位当前分类/标签的问题 效果预览分类导航栏 标签导航栏 新建 catalog_list.js[Blogroot]\themes\butterfly\scripts\helpers\ 目录下新建文件 catalog_list.js,type 参数表示生成 分类导航栏 categories 还是 标签导航栏 tags,其中 <sup>${item.length}</sup> 是使用上标显示文章数量,可参考Butterfly 标签云增加文章数上下标。 1234567891011hexo.extend.helper.register('catalog_list', function (type) { ...

2022-07-28
Butterfly 分类标签归档页增加文章索引
前言本文教程主要针对 Hexo Butterfly 主题博客,基于原版主题增加文章索引可能不够美观,只是分享思路,有兴趣和有基础的小伙伴可以对此二次魔改。 开发思路:参考 Hexo 页面变量 中的 page.current 获取当前页码,以及 Hexo 配置文件中 [Blogroot]\_config.yml 的 per_page 每页显示的文章量计算文章索引。 修改文章渲染函数打开 \themes\butterfly\layout\includes\mixins\article-sort.pug 文件。 butterfly4.2.2本站魔改基于原版主题,增加文章索引可能不够美观,只是分享思路。 修改以下代码 12345678910111213141516171819202122- mixin articleSort(posts)+ mixin articleSort(posts, current) .article-sort - var year - posts.each(function (article) { -...

2021-06-03
Butterfly 微博热搜侧边栏
前言本文教程主要针对 Hexo Butterfly 主题博客,使用 Vercel API 爬取微博热搜,具体效果可以查看本站侧边栏微博热搜板块。 2021-09-07 新浪微博热搜增加“音”、“影”、“剧”、“综”等标签,教程同步增加相应的 css 样式。 2021-09-28 由于微博热搜改为了异步加载,旧的爬取方法暂时不能用了,可以去 GitHub 更新代码,也可以参考 Python 代码,可以使用其他方法(可能会出现跨域)请求 微博热搜数据。 2023-03-20 文章 weibo-top-api.vercel.app 地址已失效,vercel 需要绑定域名使用,可以改成 weibo.eurkon.com,尽量自己新建 Vercel。 card_weibo.js可以使用博主的 card_weibo.js 地址,或者自己创建 card_weibo.js...

2022-08-16
Butterfly 推荐文章增加文章描述
前言本文用于 butterfly 魔改,博主没有测试是否适配于其他主题,以及自定义样式 CSS 可能需要一定的前端知识进行优化。 _config.butterfly.yml 配置文件可修改显示 文字描述(文章 description 属性)还是 文章内容(默认截取 500 字),以及推荐文章数量。 12345# Related Articlesrelated_post: enable: true limit: 6 # Number of posts displayed date_type: created # or created or updated 文章日期顯示創建日或者更新日 12345678# Display the article introduction on homepage# 1: description# 2: both (if the description exists, it will show description, or show the auto_excerpt)# 3: auto_excerpt (default)# false: do...
评论