2 Star 8 Fork 6

院主/typecho-fans插件库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

AbbrSlug

对标 hexo-abbrlink 插件

以下参照了 hexo-abbrlink 的文档

主题 Mirages 不生效问题

将 21 22 行 代码替换如下

// Typecho_Plugin::factory('Widget_Contents_Post_Edit')->write = array('AbbrSlug_Plugin', 'render');
// Typecho_Plugin::factory('Widget_Contents_Page_Edit')->write = array('AbbrSlug_Plugin', 'render');
Typecho_Plugin::factory('Mirages_Plugin')->writePost = array('AbbrSlug_Plugin', 'render');
Typecho_Plugin::factory('Mirages_Plugin')->writePage = array('AbbrSlug_Plugin', 'render');

再将插件 禁用 重启即可

设置:

alg -- 算法 (目前支持 crc16 和 crc32, 默认crc2)
rep -- 进制显示 (sulg 会显示10进制和16进制)

例子

生成的 slug 会像下面显示:

crc16 & hex https://tmp.com/posts/66c8.html

crc16 & dec https://tmp.com/posts/65535.html crc32 & hex https://tmp.com/posts/8ddf18fb.html

crc32 & dec https://tmp.com/posts/1690090958.html

限制

crc16 算法最大支持 65535 个文章 (个人博客来说已经完全够了)

感谢

NoahDragon Rozbo

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/taotecode/typecho_fans_plugin_library.git
git@gitee.com:taotecode/typecho_fans_plugin_library.git
taotecode
typecho_fans_plugin_library
typecho-fans插件库
master

搜索帮助