Best practice is to read the release notes.
Isn’t this about writing hugo templates with fallbacks, if a feature is not available?
E.g. a theme author does not know which hugo version a project uses.
There is
min_version = "0.30.2"
in theme.toml
but this is only for published themes… EDIT: theme.toml is for any theme - see @bep’s answer below
https://gohugo.io/variables/hugo/
.Hugo.Version
the current version of the Hugo binary you are using
Maybe in addition something like:
.Hugo.hasFeature "foo"
true if feature foo is available, else false
e.g.
.Hugo.hasFeature ".Resources.Match"
Would that make sense?