Hugo

Alphabetize while ignoring articles: "the" "an" "a"

I was wondering if anyone has any suggestions, when ordering content alphabetically, on how to ignore prefixed articles such as “the”, “an”, or “a”. I have dozens of tags on my content, and when listing them out, I would like them to be ordered alphabetically while ignoring any articles that would effect the order. Furthermore, displaying the article at the end of the tag, as shown below, would be most ideal.

Here is some example code:

<ul>
{{ range .Site.Taxonomies.tags.Alphabetical }}
	<li>{{ .Name }}</li>
{{ end }}	
</ul>

Out of the box .Alphabetical would display as:

  • Authority
  • Character
  • Redemption
  • The Garden
  • The Mind

What I would like to achieve is:

  • Authority
  • Character
  • Garden, The
  • Mind, The
  • Redemption

Thank you for all assistance!

can you change your tags in this way?

What about other languages?

In Gemans we shhould ignore der, die, das
in French and Spanish we should ignore la,le,les

What about sorting leading numbers ?
6 in front of 10 ??

NOT so EASY.

Another thought… Call the tag Garden, The and add an alias for The Garden? I did not test it though… But that would probably account for language specific setups… Only con point would be that you would have to add a taxonomy setup file for each version that has aliases.