永久链接
发表于|更新于
|浏览量:
文章生成永久链接
使用 hexo-abbrlink 的 Hexo 插件来实现文章生成永久链接,安装命令如下:
1 | npm install hexo-abbrlink --save |
在 Hexo 根目录下的 _config.yml 文件中,新增以下的配置项:
1 | abbrlink: |
将 _config.yml 文件中的 permalink 的值修改为如下内容:
1 | permalink: posts/:abbrlink.html # 此处可以自己设置,也可以直接使用 :/abbrlink |
执行 hexo clean && hexo g 重新生成博客文件,就可以生成永久链接。生成完后,原 md 文件的 Front-matter 内会增加 abbrlink 字段,值为生成的 ID 。
相关推荐
2022-11-17
今日诗词
念两句诗 挑选中... jinrishici.load(function(result) { poem.innerHTML = result.data.content info.innerHTML = '【' + result.data.origin.dynasty + '】' + result.data.origin.author + '《' + result.data.origin.title + '》' document.getElementById("poem").value(poem); document.getElementById("info").value(info); }); 添加每日一言获取中...
2024-09-13
侧边栏电子钟
效果如下所示 卸载原版时钟在博客根目录[Blogroot]下打开终端,运行以下指令 12# 卸载原版电子钟npm uninstall hexo-butterfly-clock 安装新版插件安装插件,在博客根目录[Blogroot]下打开终端,运行以下指令: 1npm install hexo-butterfly-clock-anzhiyu --save 添加配置信息可以写在在站点配置文件_config.yml或者主题配置文件_config.butterfly.yml中 123456789101112131415161718192021# electric_clock# see https://anzhiy.cn/posts/fc18.htmlelectric_clock: enable: true # 开关 priority: 5 #过滤器优先权 enable_page: all # 应用页面 exclude: # - /posts/ # - /about/ layout: type: class name: sticky_layout in...
2024-05-07
anzhiyu 主题配置
主题安装 (npm安装): 1npm i hexo-theme-anzhiyu 通过 npm 安装会在 node_modules 里生成 应用主题打开 Hexo 根目录下的 config.yml, 找到以下配置项,把主题改为anzhiyu 1234# Extensions## Plugins: https://hexo.io/plugins/## Themes: https://hexo.io/themes/theme: anzhiyu 安装 pug 和 stylus 渲染插件1npm install hexo-renderer-pug hexo-renderer-stylus --save 无法安装可以使用cnpm进行安装 1npm install hexo-renderer-pug hexo-renderer-stylus --save --registry=http://registry.npmmirror.com 本地启动 hexo 123hexo clhexo ghexo s 顶部图如果不要显示顶部图,可直接配置 disable_t...
2025-04-10
next 主题配置
主题下载安装进入命令行,下载 NexT 主题,输入: 1git clone https://github.com/theme-next/hexo-theme-next themes/next 修改站点配置文件_config.yml,找到如下代码: 12## Themes: https://hexo.io/themes/theme: landscape 将 landscape 修改为 next 切换主题next 主题自带四种样式。 在主题配置文件/next/_config.yml中查找:scheme,找到如下代码: 123456# Schemesscheme: Muse#scheme: Mist#scheme: Pisces#scheme: Gemini选择一种样式,去掉前面的 #,其他主题前加上 # 隐藏网页强力驱动隐藏网页底部 powered By Hexo / 强力驱动打开 themes/next/layout/_partials/footer.swig 找到 12345678910111213141516{% if theme.foote...
2025-04-05
便携小空调设置
部署方案在博客根目录执行命令: 1hexo new page air-conditioner 会生成source/air-conditioner/index.md, 将以下内容替换原内容 12345678910111213141516171819---title: 便携小空调 - 为你的夏日带去清凉!date: 2022-10-20 22:06:17comments: trueaside: falsetop_img: false---> 终于为博客安装上了便携小空调<style>.copyright-box a { border-bottom: none !important; padding: 0 !important;}</style><div id="air-conditioner-vue"></div><script defer data-pjax src='https://npm.elemecdn.com/anzhiyu-air-conditioner@...
2025-04-05
hexo导航页错误
网站运行时如没有对应的导航页面打开后会报错 这是因为还需要运行如下命令新建相关page 123hexo new page "about"hexo new page "tags"hexo new page "categories" 新建 page 后,会在 source 目录下新建 about、tags、categories文件夹,每个文件夹下还会创建一个index.md文件表示关于、标签页分类页面,编辑这三个MarkDown文件可以自定义这三个页面的内容.最后一步,编辑各页面对应的index.md文件,增加 type 即可。注意冒号 : 后必须空一格,title 和 date 是默认生成的。重新部署后能够看到效果。 1234567891011121314151617---title: aboutdate: 2021-03-13 15:21:30type: "about"--- ---title: tagesdate: 2021-03-13 15:21:30type: "tags&qu...
公告
欢迎来看我的博客鸭~
纸飞机
退出:esc
方向控制: ←↑→
射击:Space
轰炸:B