sectionPagesMenu default weight

Is there a way of setting a default weight for menu items added via sectionPagesMenu I’ve yet to find one and my section pages seem to always be added on last.

The default is 0. So you might use -1 and 1 to sort pages before and after unsorted pages.

Other than that there are plenty of filters when you range through pages where you can order by title, date, etc.

Doesn’t seem to work
sectionPagesMenu = "main"

title: Contact
        weight: 100

and contact is still at the front


Specifying a weight for the Contact page will not change its menu position relative to the sections added by sectionPagesMenu = "main" because items with no weight or zero weight are both considered to have their weights undefined, and they will sort to the bottom. This applies to weights on pages as well.

So if I have these menu items:

Name Weight
A 10
B 0
D -10

The sorted list will be:


Instead of using the sectionPagesMenu setting, explicitly define the menu items in your site configuration. This will give you more control.

So the easiest (and perhaps only-est) method is to create an for each section with

        weight: 1

in it?

I think the easiest method is to define your menus in site configuration.

name = "Contact"
url = "/contact/"
weight = 2

name = "Posts"
url = "/Posts/"
weight = 1

url = "/Articles/"
weight = 3