Added Go runtime version to the layout footer

This commit is contained in:
Gregory Ballantine 2024-05-29 11:04:31 -04:00
parent e3e4e24e56
commit 1e87466ccb
4 changed files with 11 additions and 5 deletions

View File

@ -4,7 +4,7 @@ VERSION=`git describe --tags`
.PHONY: build .PHONY: build
## build: Compile the packages. ## build: Compile the packages.
build: 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 .PHONY: run
## run: Build and Run in development mode. ## run: Build and Run in development mode.

View File

@ -1,5 +1,10 @@
package app package app
var ( import (
Version string = "N/a" "runtime"
)
var (
AppVersion string = "N/a"
RuntimeVersion string = runtime.Version
) )

View File

@ -3,7 +3,7 @@
<!-- footer --> <!-- footer -->
<nav id="main-footer"> <nav id="main-footer">
<p>BLT version {{ .app_version }}</p> <p>BLT version {{ .app_version }} | Built with Go {{ .runtime_version }}</p>
</nav> </nav>
</body> </body>

View File

@ -7,5 +7,6 @@ import (
) )
func CustomVars(data template.Data) { func CustomVars(data template.Data) {
data["app_version"] = app.Version data["app_version"] = app.AppVersion
data["runtime_version"] = app.RuntimeVersion
} }