streats / streats.github.io

My personal website showcasing my professional portfolio and miscellaneous notes
https://streats.github.io/
4 stars 1 forks source link

Sort menu links in desired order #6

Closed streats closed 3 months ago

streats commented 1 year ago

Current:

  1. About
  2. Accessibility statement
  3. Contact
  4. Craft notes
  5. Writing samples
  6. Case studies
  7. Welcome
  8. Resumé

Desired:

  1. Welcome
  2. About
  3. Resumé
  4. Writing samples
  5. Case studies
  6. Craft notes
  7. Accessibility statement
  8. Contact
streats commented 7 months ago
I added navigation_weight to each page's frontmatter as follows: filename title navigation_weight
index.md Welcome 1
about.md About 2
resume.md Resumé 3
/work/index.md Writing samples 4
/case-studies/index.md Case studies 5
/craft-notes/index.md Craft notes 6
accessibility-statement.md Accessibility statement 7
contact.md Contact 8

This should create the order:

  1. Welcome
  2. About
  3. Resume
  4. Writing samples
  5. Case studies
  6. Craft notes
  7. Accessibility statement
  8. Contact

But it hasn't. I can't figure out what order it's based on. It starts alphabetical, then appears random.

streats commented 7 months ago

I updated config.yml to include the list of links in the order but that also doesn't seem to have made a difference.

streats commented 3 months ago

I changed the weights to be multiples of 10 (10,20,30, etc) as otherwise it will eventually sort as 1, 10, 11, etc.

streats commented 3 months ago

OK so I renamed a few files numerically (01_about.md, 02_resume.md) and it sorted by those. This isn't ideal because I want /work to be the 4th link and I can't rename that numerically because it's a subdirectory.

streats commented 3 months ago

I reverted the namefiles and just removed the theme reference in _config.yml so it now doesn't use a theme at all and thus has no menu. This is fine for now as I manually link to most pages (except contact) from the home page.

streats commented 3 months ago

Fixed