gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
74.63k stars 7.45k forks source link

min_version is treated as a float, thus can't have two dots like 0.18.1 #3025

Closed anthonyfok closed 7 years ago

anthonyfok commented 7 years ago

Perhaps a bug, and perhaps not a bug:

After building a local copy of themes.gohugo.io using spf13/hugoThemeSiteScript, running hugo server -s hugoThemeSite/themeSite fails to start the server due to the following fatal error:

ERROR: page.go:1309: Error parsing page meta data for startbootstrap-clean-blog.md
ERROR: page.go:1310: (15, 15): cannot have two dots in one float
ERROR: page.go:683: (15, 15): cannot have two dots in one float

It turns out that the author of the said theme has set the min_version in his theme.toml to 0.18.1, but min_version is currently treated as a float number in hugo, and thus can't have two or more "decimal points".

I have sent a pull request to change 0.18.1 to 0.18 at humboldtux/startbootstrap-clean-blog#26

Though I wonder if we should change min_version to read a string (so 0.18.1 would work) in some future version, or if we should just document the current behaviour?

moorereason commented 7 years ago

We should start using https://github.com/Masterminds/semver.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.