Hexo博客设置永久网址链接

一、方法一

这是我是用的方法:自定义路径法

修改根目录下_config.yml的内容,定位到:permalink

1
2
3
4
5
6
7
8
9
# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'

url: https://your-domain.com
permalink: posts/:myurl.html
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks
  • 修改 year/:month/:day/:title/ 为:posts/:my.html
  • 在博客文章中添加一个属性:myurl ;其内容即为网址后缀

方法参考: https://www.immaxfang.com/hexo-change-default-post-url/

二、方法二

插件法

教程: https://cloud.tencent.com/developer/article/1662763

插件 GitHub 地址: https://github.com/rozbo/hexo-abbrlink

三、参考链接


#自定义路径法 #修改根目录 #permalink #URL #网址后缀 #博客文章 #属性 #插件法 #GitHub #Hexo #永久链接格式 #后缀 #title


Hexo博客设置永久网址链接
https://blog.pppfz.com/posts/13.html
作者
PPPFZ
发布于
2024年4月24日
许可协议