pipecraftnet / flarum-ext-id-slug Goto Github PK
View Code? Open in Web Editor NEWA Flarum extension. Use id as slug in discussion URL.
Home Page: https://pzwd.net/d/14
License: MIT License
A Flarum extension. Use id as slug in discussion URL.
Home Page: https://pzwd.net/d/14
License: MIT License
Hi! Flarum now comes with a slug driver system, where you can specify functions to map an abstract slug to/from a model instance. You could use this to implement this feature without editing the database directly.
For example, a User IdSlugDriver: https://github.com/flarum/core/blob/eed449a3ea3e898b7186ea39c80d7a09dbfd5fed/src/User/IdSlugDriver.php#L15-L15
判断是不是包含非英语字符串,然后根据设置处理成只留 ID 或 ID 加标题。
由于FreeFlarum将Flarum版本提升到1.3.0,而这个版本中Flarum默认的主题帖的slug由ID+标题(仅英文)改为了id+标题(标题为汉语拼音),就比如说 https://dipper.freeflarum.com/d/55-guan-yu-yi-ge-yong-yu-lian-luo-ge-di-di-fang-zu-zhi-he-ren-yuan-de-ping-tai-de-jian-li-de-ke-neng-xing-tao-lun/ 。这就使得其URL过于冗长。因此,你的Flarum插件所要发挥的作用就比Flarum更新前所发挥的大得多。
我把你的插件推荐给了FreeFlarum官方。他们把插件安装到了FreeFlarum上。可是我在启用此扩展后,新发布帖子的slug仍为id+标题(标题为汉语拼音)。我也未能在常规设置里找到管理slug的选项。这就意味着你的插件在Flarum1.3.0上面失效了。这个插件目前已经非常重要。希望你能够对其作出修改,使其能够在Flarum1.3.0上面正常运行。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.