picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.82k stars 616 forks source link

Pivo CMS 2.0 sorting menu #481

Closed CodeTipsy closed 5 years ago

CodeTipsy commented 5 years ago

Hello, how to sort menu items in the Pico 2.0 ?

Best regards

PhrozenByte commented 5 years ago

Please check Pico's config/config.yml.template, pages_order settings.

CodeTipsy commented 5 years ago

My menu: Home, Contact, About us, Impressum, Poducts concert in Home, Products, About us, Contact, Impressum.

config.yml pages_order_by_meta: ? pages_order_by: ? pages_order: ?

What should I do?

Thank you.

PhrozenByte commented 5 years ago

Add nav: 1, nav: 2, nav: 3, … to the YAML Front Matter of your pages (use the numbers to define the order of the pages) and use the following pages_order config in your config/config.yml:

pages_order_by_meta: nav
pages_order_by: meta
pages_order: asc
CodeTipsy commented 5 years ago

That's exactly what I was looking for. Works great! Many thanks PhrozenByte.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: