hugo: Index | Files

package hugo

import ""


Package Files

hugo.go vars_regular.go version.go version_current.go


const (
    EnvironmentDevelopment = "development"
    EnvironmentProduction  = "production"


var CurrentVersion = Version{
    Number:     0.81,
    PatchLevel: 0,
    Suffix:     "-DEV",

CurrentVersion represents the current build version. This should be the only one.

var IsExtended = false

func BuildVersionString Uses

func BuildVersionString() string

BuildVersionString creates a version string. This is what you see when running "hugo version".

func CompareVersion Uses

func CompareVersion(version interface{}) int

CompareVersion compares the given version string or number against the running Hugo version. It returns -1 if the given version is less than, 0 if equal and 1 if greater than the running version.

func GetExecEnviron Uses

func GetExecEnviron(workDir string, cfg config.Provider, fs afero.Fs) []string

func GoMinorVersion Uses

func GoMinorVersion() int

type Info Uses

type Info struct {
    CommitHash string
    BuildDate  string

    // The build environment.
    // Defaults are "production" (hugo) and "development" (hugo server).
    // This can also be set by the user.
    // It can be any string, but it will be all lower case.
    Environment string

Info contains information about the current Hugo environment

func NewInfo Uses

func NewInfo(environment string) Info

NewInfo creates a new Hugo Info object.

func (Info) Generator Uses

func (i Info) Generator() template.HTML

Generator a Hugo meta generator HTML tag.

func (Info) IsProduction Uses

func (i Info) IsProduction() bool

func (Info) Version Uses

func (i Info) Version() VersionString

Version returns the current version as a comparable version string.

type Version Uses

type Version struct {
    // Major and minor version.
    Number float32

    // 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 Uses

func MustParseVersion(s string) Version

MustParseVersion parses a version string and panics if any error occurs.

func ParseVersion Uses

func ParseVersion(s string) (Version, error)

ParseVersion parses a version string.

func (Version) Next Uses

func (v Version) Next() Version

Next returns the next Hugo release version.

func (Version) NextPatchLevel Uses

func (v Version) NextPatchLevel(level int) Version

NextPatchLevel returns the next patch/bugfix Hugo version. This will be a patch increment on the previous Hugo version.

func (Version) Prev Uses

func (v Version) Prev() Version

Prev returns the previous Hugo release version.

func (Version) ReleaseVersion Uses

func (v Version) ReleaseVersion() Version

ReleaseVersion represents the release version.

func (Version) String Uses

func (v Version) String() string

func (Version) Version Uses

func (v Version) Version() VersionString

Version returns the Hugo version.

type VersionString Uses

type VersionString string

VersionString represents a Hugo version string.

func (VersionString) Compare Uses

func (h VersionString) Compare(other interface{}) int

Compare implements the compare.Comparer interface.

func (VersionString) Eq Uses

func (h VersionString) Eq(other interface{}) bool

Eq implements the compare.Eqer interface.

func (VersionString) String Uses

func (h VersionString) String() string

Package hugo imports 13 packages (graph) and is imported by 72 packages. Updated 2020-12-31. Refresh now. Tools for package owners.