package version
import "github.com/gohugoio/hugo/common/version"
Index ¶
- func CompareVersions(v1 Version, v2 any) int
- func GoMinorVersion() int
- type Version
- func MustParseVersion(s string) Version
- func ParseVersion(s string) (Version, error)
- func (h Version) Compare(other any) int
- func (v Version) IsAlphaBetaOrRC() bool
- func (v Version) Next() Version
- func (v Version) NextPatchLevel(level int) Version
- func (v Version) Prev() Version
- func (v Version) ReleaseVersion() Version
- func (v Version) String() string
- func (v Version) Version() VersionString
- type VersionString
Functions ¶
func CompareVersions ¶
CompareVersion compares v1 with v2. It returns -1 if the v2 is less than, 0 if equal and 1 if greater than v1.
func GoMinorVersion ¶
func GoMinorVersion() int
Types ¶
type Version ¶
type Version struct {
Major int
Minor int
// Increment this for bug releases
PatchLevel int
// HugoVersionSuffix is the suffix used in the Hugo version string.
// It will be blank for release versions.
Suffix string
}
Version represents the Hugo build version.
func MustParseVersion ¶
MustParseVersion parses a version string and panics if any error occurs.
func ParseVersion ¶
ParseVersion parses a version string.
func (Version) Compare ¶
Compare implements the compare.Comparer interface.
func (Version) IsAlphaBetaOrRC ¶
IsAlphaBetaOrRC returns whether this version is an alpha, beta, or release candidate.
func (Version) Next ¶
Next returns the next Hugo release version.
func (Version) NextPatchLevel ¶
NextPatchLevel returns the next patch/bugfix Hugo version. This will be a patch increment on the previous Hugo version.
func (Version) Prev ¶
Prev returns the previous Hugo release version.
func (Version) ReleaseVersion ¶
ReleaseVersion represents the release version.
func (Version) String ¶
func (Version) Version ¶
func (v Version) Version() VersionString
Version returns the Hugo version.
type VersionString ¶
type VersionString string
VersionString represents a Hugo version string.
func (VersionString) Compare ¶
func (h VersionString) Compare(other any) int
Compare implements the compare.Comparer interface.
func (VersionString) Eq ¶
func (h VersionString) Eq(other any) bool
Eq implements the compare.Eqer interface.
func (VersionString) String ¶
func (h VersionString) String() string
func (VersionString) Version ¶
func (h VersionString) Version() Version
Source Files ¶
- Version
- v0.153.4 (latest)
- Published
- Dec 28, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 4 months ago –
Tools for package owners.