feat: include app version in sidebar footer
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m0s

This commit is contained in:
juancwu 2026-02-09 21:51:16 +00:00
commit b47e48b882
7 changed files with 46 additions and 7 deletions

View file

@ -8,11 +8,12 @@ import (
)
const (
UserKey string = "user"
ProfileKey string = "profile"
URLPathKey string = "url_path"
ConfigKey string = "config"
CSRFTokenKey string = "csrf_token"
UserKey string = "user"
ProfileKey string = "profile"
URLPathKey string = "url_path"
ConfigKey string = "config"
CSRFTokenKey string = "csrf_token"
AppVersionKey string = "app_version"
)
func User(ctx context.Context) *model.User {
@ -59,3 +60,12 @@ func CSRFToken(ctx context.Context) string {
func WithCSRFToken(ctx context.Context, token string) context.Context {
return context.WithValue(ctx, CSRFTokenKey, token)
}
func AppVersion(ctx context.Context) string {
version, _ := ctx.Value(AppVersionKey).(string)
return version
}
func WithAppVersion(ctx context.Context, version string) context.Context {
return context.WithValue(ctx, AppVersionKey, version)
}