WIP on adding htmax option (#59)

This commit is contained in:
2026-07-05 17:54:36 -04:00
parent 7c588662d2
commit 9d2277ab32
10 changed files with 81 additions and 15 deletions
+8 -2
View File
@@ -255,10 +255,16 @@ let parser =
it.RegisterEmptyTag("page_foot",
fun writer encoder context ->
let webLog = context.App.WebLog
if webLog.AutoHtmx then
context.App.WebLog.RelativeUrl(Permalink StaticAssetUrl.htmx[1..])
match webLog.AutoHtmx with
| NoAutoHtmx -> None
| AutoHtmx -> (Permalink >> Some) StaticAssetUrl.htmx[1..]
| AutoHtmax -> (Permalink >> Some) StaticAssetUrl.htmax[1..]
|> function
| Some url ->
context.App.WebLog.RelativeUrl url
|> sprintf "%s<script src=\"%s\"></script>" s
|> writer.WriteLine
| None -> ()
if assetExists "script.js" webLog then
themeAsset (StringValue "script.js") context
|> sprintf "%s<script src=\"%s\"></script>" s