mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
Added top level .Hugo variable with version, commit and generator information + docs
Added Version, CommitHash and BuildDate to hugolib/hugo.go and used it in build Removed commitHash and buildDate from commands/version.go and used hugolib vars Removed getDateFormat function from commands/version.go Conflicts: README.md docs/content/templates/variables.md
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Hugo
|
||||
A Fast and Flexible Static Site Generator built with love by [spf13](http://spf13.com)
|
||||
A Fast and Flexible Static Site Generator built with love by [spf13](http://spf13.com)
|
||||
and [friends](http://github.com/spf13/hugo/graphs/contributors) in Go.
|
||||
|
||||
[](https://travis-ci.org/spf13/hugo)
|
||||
@@ -27,10 +27,10 @@ kind of website including blogs, tumbles and docs.
|
||||
|
||||
## Installing Hugo
|
||||
|
||||
Hugo is written in Go with support for Windows, Linux, FreeBSD and OS X.
|
||||
Hugo is written in Go with support for Windows, Linux, FreeBSD and OS X.
|
||||
|
||||
The latest release can be found at [Hugo Releases](https://github.com/spf13/hugo/releases).
|
||||
We currently build for Windows, Linux, FreeBSD and OS X for x64
|
||||
We currently build for Windows, Linux, FreeBSD and OS X for x64
|
||||
and i386 architectures.
|
||||
|
||||
### Installing Hugo (binary)
|
||||
@@ -89,7 +89,7 @@ Instead, it is possible to have the `version` sub-command return information abo
|
||||
|
||||
To do this, replace the `go build` command with the following *(replace `/path/to/hugo` with the actual path)*:
|
||||
|
||||
go build -ldflags "-X /path/to/hugo/commands.commitHash `git rev-parse --short HEAD 2>/dev/null` -X github.com/spf13/hugo/commands.buildDate `date +%FT%T%z`"
|
||||
go build -ldflags "-X /path/to/hugo/hugolib.CommitHash `git rev-parse --short HEAD 2>/dev/null` -X github.com/spf13/hugo/hugolib.BuildDate `date +%FT%T%z`"
|
||||
|
||||
This will result in `hugo version` output that looks similar to:
|
||||
|
||||
|
Reference in New Issue
Block a user