Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the order of menu items #1

Open
bjonnh opened this issue Sep 16, 2015 · 3 comments
Open

Set the order of menu items #1

bjonnh opened this issue Sep 16, 2015 · 3 comments

Comments

@bjonnh
Copy link

bjonnh commented Sep 16, 2015

How to set the order of menu/sidebar items?

@enten
Copy link
Owner

enten commented Sep 17, 2015

I expected that data files could be sorted as did content list template.

Actually I think that there haven't method to sort data files.

When there is that method, we can add "weight" to order menu.

@KSubedi
Copy link
Contributor

KSubedi commented Nov 9, 2015

The menu items are loaded in alphabetical order. So instead of doing this in data/Menu.toml :

[about]
    Name = "About"
    URL = "/about"

[posts]
    Name = "Posts"
    Title = "Show list of posts"
    URL = "/post"

[tags]
    Name = "Tags"
    Title = "Show list of tags"
    URL = "/tags"

you can do this:

[1]
    Name = "About"
    URL = "/about"

[2]
    Name = "Posts"
    Title = "Show list of posts"
    URL = "/post"

[3]
    Name = "Tags"
    Title = "Show list of tags"
    URL = "/tags"

and it will show the menu items in the order you put them in numerically.

enten pushed a commit that referenced this issue Nov 24, 2015
@hiproz
Copy link

hiproz commented Dec 19, 2015

yes, i try the above @KSubedi 's code ,it is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants