简体   繁体   English

Jekyll排序重音符号

[英]Jekyll Sorting Accentuated Characters

I'm failing to sort posts titles containing accentuated characters. 我无法对包含强调字符的帖子标题进行排序。

Using: 使用:

{% assign sorted_posts = (site.posts | sort: 'title') %}

I get: 我得到:

  • Aujourd'hui Dimanche Aujourd'hui Dimanche
  • Bientôt la nuit 本特诺特
  • À vendre 阿旺德

What I would like is getting: 我想要得到的是:

  • Aujourd'hui Dimanche Aujourd'hui Dimanche
  • À vendre 阿旺德
  • Bientôt la nuit 本特诺特

In other word, make as if 'A' was equal to 'À'. 换句话说,使“ A”等于“À”。

Any clue? 有什么线索吗?

Thanks in advance 提前致谢

I'm afraid that the only solution is to make a generator plugin that use I18n.transliterate to transform accented characters from title and create something like a slug field for each post. 恐怕唯一的解决办法是使发电机插件使用I18n.transliterate从标题变换重音符号和创造这样一个slug每篇文章场。

Posts will then be sortable by slug. 然后,帖子将可以按段排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM