For all functions, the leading lowercase āvā of the argument(s) would be optional.
It would take several release/upgrade cycles for this to be useful (similar to adding the .IsExtended method in v0.83.0), so if we want to do it, sooner is better.
We already have a VersionString type that supports all of the above ops. Iām not sure if itās fully semver compatible, but itās what Hugo uses, so itās ā¦ Hugo compatible. I think itās exposed in a template somehow, but the main take is that we donāt want to re-implement all of the ne/ge/gt ā¦ in yet another API.
We certainly do some magic in other situations as well, so we could also maybe do
{{ gt "v0.100.0" "v0.101.3" }} ---> false
But that said, Iām not sure where this came from. We at least should have enough tools to determine if the current Hugo version is before/after a given string.
Itās probably because I did the min/max partial thing because I didnāt find anything in the docs for doing checks on hugo.Version vs. some string. If that exists (Iāll do some testing shortly) then Iāll add some docs on how to do it with the existing checks since it was totally not obvious to me that there was a way to do it without something like my partial.
EDIT: Well that makes things a lot easier. Iāll run it through my tests since I have them anyway, but Iām thinking Hugoās automagic typing caught me surprise and still blows my mind!
It simply never occurred to me that Hugo already could automatically convert a string to a sufficiently āproperā version string for what I wanted without external functions.
EDIT Again: Wow! This is one of those things that āJust Worksā¢!ā that I would never have expected, and either missed in the docs, or will be adding a hopefully prominent enough not that others donāt make the same mistake (I spent far too much time on this, for something that didnāt need doing).