The-Encryption-Compendium / TECv2

Hugo-based version of The Encryption Compendium.
https://encryptioncompendium.org
GNU General Public License v3.0
4 stars 1 forks source link

tags that contain a # symbol don't work right #45

Open dkg opened 3 years ago

dkg commented 3 years ago

there are three tags that appear to contain a # symbol in the current database:

clicking on any of these links from the /tags/ URL leads to link targets like https://the-encryption-compendium.github.io/tags/%5C%5C#aabill/ -- this is problematic for at least three different ways:

The actual tag landing page appears to have the double-backslash (represented as %5c) in it, followed by the percent-escaped octothorpe (as %23): https://encryptioncompendium.org/tags/%5c%5c%23aabill/

Fixing this correctly seems likely to be fiddly -- there are likely to be several places that need fixing. But perhaps the simplest way to avoid the problem is to forbid the use of the # character in a tag label. This kind of constraint might be enforced as part of the bibtex consistency check that should probably be run before a site build.

kernelmethod commented 3 years ago

Yeah, this is part of a bigger bug that I flagged in #16, although the # symbol is a particularly obnoxious case of that bug. As you mentioned, fixing this bug is difficult, especially when you look at some of the other cases that can occur (tags with spaces or unicode in them, tags like 9/11 with / in them, etc.). My go-to solution for this would be to try to slugify the tags as I did with the compendium entry titles, but Hugo makes it difficult to do that kind of thing.

I'm thinking it might be better to work around all of this by just getting rid of the /tags/ URL altogether for looking up articles with a given tag, since I don't really think it meshes very well with the rest of the site anyways. IMO it'd be better to change the search page to allow lookups based on tags -- for example, include a little drop-down box where folks can select a handful of tags that they want to search on, or something to that effect.

dkg commented 3 years ago

fwiw, I like having the /tags/ URL -- it'd be even neater with a "tag cloud" that emphasizes popular tags based on their frequency. But most of the problems outlined above wouldn't be solved by removing it (e.g. each tag's own page, the tag-specific links that show up on each entry's page). Why not just constrain tags directly to alphanumeric ASCII plus some non-objectionable punctuation (e.g. . and - and _) until these other problems are solved?

As long as the tags are all entered and maintained by staff, sticking to those constraints shouldn't be problematic.