Hugo Menus Sort Order

I’ve been working on porting my ancient main website to Hugo on and off for almost a year. The reason my site hasn’t had a major update in over 20 years is the difficulty in creating site menus.

The original site was designed with a full custom theme in FrontPage with its great drag and drop GUI menu builder. In 20 years I have never found any other tool that makes menu creation so easy. I’d heard the very expensive Macromedia (now Adobe) Dreamweaver has something but I’ve never been able to try it out, and frankly won’t spend that kind of money on a personal website.

Every year I’d search for something with an easy to use menu builder but I’ve never found anything. So I finally gave up and settled for the Hugo static site builder system. It sucks having to create the menu system in plain text but I had to give in.

One thing that has bugged me is that nowhere could I find a definitive explanation of how the menu system sorts entries. Today I persisted in searching and was able to piece together an answer and come up with a methodology that works for me.

Here’s a list of the important points

  • Order within the menu configuration text is ignored because Hugo menus can be defined in front matter or in two different ways in the site configuration. This makes it difficult to near impossible to allow a code position sort order.
  • The default sort is ascending by weight then alphabetical by name within a menu level

Most of the time I want my menus sorted by name with only one item forced to a specific position, so I’ve come up with this strategy.

  • Manually sort the parent and child menu entries in the order you want them to display as a visual reference.
  • Assign a weight to each top level (parent) item starting with 10 and incrementing by 10 for each parent level
  • Assign the same weight as the parent to each sub level (child) item
  • When rendered, if the order is different compared to the desired order, adjust the weight of the menu items to compensate.

Rules for a Happy Family Group

Here are the simple most basic rules of civility that my parents taught me. Throughout my over 60 years of existence these rules have proven themselves to be essential for a happy family group.

For groups of five or more family members:

  • Be polite
  • Be respectful
  • Keep your mental issues out (they should be discussed in smaller groups or even better with an appropriate certified and licensed mental health professional)
  • No trolling (pushing people’s buttons in a mean way)

For groups larger than ten or more family members add:

  • No political discussions
  • No religious discussions

Any person who can not agree to these rules is not welcome to be part of my family group.

Frankly this is just a tiny subset of what are often called common decency. Most of the other common decency and politeness rules were also imposed by my parents.

For groups of four or less family members the rules can be whatever the group desires. If they all want to fight and scream that’s their business.

If someone transgresses the rules all they need do to come back into the group is apologize for being impolite and promise to try to never do it again.

Even after years apart if the former family member is now willing to apologize for being impolite and promise to try to never do it again, they will be welcomed back.

Floridian’s Please Note

If you think there is anything beneficial in slavery to the enslaved, you are a horrible person who should be enslaved for a few years so that you can experience the supposed benefits first hand.

The willingness to show blatant bigotry and racism by Florida Republicans is surprising only that they are now so delusional that they think some good people somewhere agree with them. Hint, believing there is anything good about slavery makes you a very bad person.

Fingers Crossed

I just got an Android system update notification on my Pixel 6A.

Did Google fix the very bad battery drain problem they created a couple weeks ago?

The answer is …

Update 3 hours later, SUCCESS!

My battery drain is back to the low rate I had before the bad update.

Culture of Fear

It saddens me that fools on the internet dispensing advice and politicians (mostly republican) have instilled so much irrational fear in the population that these stories exist.

Confused TikTok Mom Asks for Help When Random Child Comes Over To Play With Her Kid

54% of Protestant Churches Rely in Part on Armed Church Members for Security

Crime is lower now than during most of my over 60 years of life. I do not know anyone who was murdered, shot, stabbed, or even just beaten up in a random act of violence. (getting beat up from hanging out in rough bars is not a random act of violence, it’s an anticipated consequence)

NHTSA Considers Security

It’s good to see that the NHTSA and Automakers are going to workaround the ridiculous wireless access requirement in the Right To Repair law that I advocated and voted against. There is NO truly secure remote access, and the control systems of a modern car are far to dangerous to risk it so that auto techs can save a few seconds by not plugging in a communications cable..

Check out the article from Ars Technica