Open dandanXO opened 5 years ago
@dandanXO Got it. 近期刚换工作,比较忙,空闲时间我看下。
经过长时间调研,发现没有特别完美的解决方案,目前痛点如下:
目前可行性方案评估如下:
通过页面id(window.location.pathname) -> 只能解决痛点1
通过页面创建时间(page.date) -> 只能解决痛点2
因为部分用户会通过copy markdown的方式去新建文章,而不是采用hexo new的方式,所以时间的方法依然会出现文章与issue不能正确匹配的问题
通过查看hexo官方文档,在文档 - Front-matter中发现了permalink
这样的属性,可以覆盖文章地址。于是window.location.pathname就可以捕捉到date+permalink
这样格式的值。
permalink: userpath -> window.location.pathname === 2019/02/28/userpath/
所以如果习惯使用中文文件名(不推荐),或者有文章分级存放的用户,请在文件头中加入该属性来避免gitment的问题。
以上。
@YuanLiChenAi @dandanXO
了解 @codefine 可以順便把我blog放上去嗎 https://blog.dandan.tw/
@dandanXO ok
發這bug 是因為如果流言issue labels 長度過長 會無法註冊issue
中文字會被url encode(label長度過長) ,目前解決方法是先將中文字urldecode 如果要徹底解決可能還是要換一個issue ID方式