Added Go runtime version to the layout footer
This commit is contained in:
parent
e3e4e24e56
commit
1e87466ccb
2
Makefile
2
Makefile
@ -4,7 +4,7 @@ VERSION=`git describe --tags`
|
||||
.PHONY: build
|
||||
## build: Compile the packages.
|
||||
build:
|
||||
@go build -o $(NAME) -ldflags "-X git.metaunix.net/bitgoblin/blt/app.Version=$(VERSION)"
|
||||
@go build -o $(NAME) -ldflags "-X git.metaunix.net/bitgoblin/blt/app.AppVersion=$(VERSION)"
|
||||
|
||||
.PHONY: run
|
||||
## run: Build and Run in development mode.
|
||||
|
@ -1,5 +1,10 @@
|
||||
package app
|
||||
|
||||
var (
|
||||
Version string = "N/a"
|
||||
import (
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
AppVersion string = "N/a"
|
||||
RuntimeVersion string = runtime.Version
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<!-- footer -->
|
||||
<nav id="main-footer">
|
||||
<p>BLT version {{ .app_version }}</p>
|
||||
<p>BLT version {{ .app_version }} | Built with Go {{ .runtime_version }}</p>
|
||||
</nav>
|
||||
|
||||
</body>
|
||||
|
@ -7,5 +7,6 @@ import (
|
||||
)
|
||||
|
||||
func CustomVars(data template.Data) {
|
||||
data["app_version"] = app.Version
|
||||
data["app_version"] = app.AppVersion
|
||||
data["runtime_version"] = app.RuntimeVersion
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user