How can I control the order of pages from within a pelican article category?

后端 未结 5 915
余生分开走
余生分开走 2021-01-12 14:28

I am using pelican jinja2 templates in order to generate a navigation menu based on the category and I need a way to control the order of the pages, or at least a trick to a

5条回答
  •  星月不相逢
    2021-01-12 14:42

    To workaround the problem, you can disable categories and pages from being displayed automatically and set the menuitems manually in the configuration:

    DISPLAY_CATEGORIES_ON_MENU = False
    DISPLAY_PAGES_ON_MENU = False
    
    MENUITEMS = (
        ('Home', '/'),
        ('Archives', '/archives.html'),
        ('Tags', '/tags.html'),
        ('Category1', 'category/category1.html'),
        ('Category2', 'category/category2.html'),
    )
    

提交回复
热议问题