Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Pelican 3.5 中,我知道我可以按属性对文章进行排序,例如
ARTICLE_ORDER_BY = 'title'
但我想按文件名排序。更改文件名比打开每个文件并编辑属性要容易得多。
尝试这个:
ARTICLE_ORDER_BY = 'filename'
或者
ARTICLE_ORDER_BY = lambda x:os.path.basename(x.source_path or '')