add the Production flag, command-line options, and DebugMode computed flag, and put it in the main places I expect it to be used

This commit is contained in:
2026-03-05 14:50:20 -07:00
parent d09e693035
commit 1f450dcf14
6 changed files with 31 additions and 11 deletions
+2
View File
@@ -16,6 +16,7 @@ import (
"net/http"
"time"
"git.erbosoft.com/amy/amsterdam/config"
"git.erbosoft.com/amy/amsterdam/database"
"github.com/klauspost/lctime"
"github.com/labstack/echo/v4"
@@ -141,6 +142,7 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an
}
}
amctxt.VarMap().Set("__bannerad", ad)
amctxt.VarMap().Set("__debugMode", config.GlobalComputedConfig.DebugMode)
if tmp := amctxt.GetScratch("frame_suppressLogin"); tmp != nil {
amctxt.VarMap().Set("__suppressLogin", true)
}
+1 -1
View File
@@ -302,7 +302,7 @@ func setupTemplates() {
templateLoaders = append(templateLoaders, embedfs.NewLoader("views/", static_views))
// Create the template renderer and add our globals to it.
views = jet.NewSet(multi.NewLoader(templateLoaders...), jet.DevelopmentMode(true))
views = jet.NewSet(multi.NewLoader(templateLoaders...), jet.DevelopmentMode(config.GlobalComputedConfig.DebugMode))
views.AddGlobal("AmsterdamVersion", config.AMSTERDAM_VERSION)
views.AddGlobal("AmsterdamCopyright", config.AMSTERDAM_COPYRIGHT)
views.AddGlobal("GlobalConfig", config.GlobalConfig)
+6 -1
View File
@@ -18,7 +18,12 @@
{{ range k, v := .FrameMetadata(0) }}
<meta http-equiv="{{ k }}" content="{{ v }}">
{{ end }}
<script src="https://cdn.tailwindcss.com"></script>
{{ if __debugMode }}
<script src="https://cdn.tailwindcss.com"></script>
{{ else }}
{* TODO - replace with reference to generated Tailwind CSS file *}
<script src="https://cdn.tailwindcss.com"></script>
{{ end }}
<link rel="stylesheet" href="/static/css/ams_style.css" />
</head>