This blog moved today from Jekyll to Hexo (and it’s now open source as well). One of the final issues I had when wrapping up the conversion was how to handle categories and tags that do not necessarily have a slug that can be naturally derived from the name. Take the “C#” category, for example. The normal slug for that category would be
c, which is an entirely different programming language; interestingly, “C++” will also normally get its slug as
Within Hexo’s default
_config.yml file, there are two empty items named
tag_map; their comments allude to a mapping, but I could not find what the proper syntax was for those items. We hopped onto the Hexo Gitter chat and asked the question, and someone pointed us to this issue. To define a mapping, create an item under either the
tag_map top-level item. The maps for this site, as they currently are, look like this:
As you can see by hovering over the links in the sidebar, “Programming > .NET > C#” ends up with a URL ending with
/programming/dot-net/c-sharp/, which is exactly what we were looking for.