diff --git a/src/Ema/Asset.hs b/src/Ema/Asset.hs index 643501c..cd91e1b 100644 --- a/src/Ema/Asset.hs +++ b/src/Ema/Asset.hs @@ -3,14 +3,11 @@ module Ema.Asset where --- | The type of assets produced by Ema. +-- | The type of assets that can be bundled in a static site. data Asset a - = -- | A static file that is copied as-is from the source directory. + = -- | A file that is copied as-is from the source directory. AssetStatic FilePath - | -- | A file whose contents are generated by user code. - -- - -- If the the file is HTML, then use `Just Html` to inform Ema's live server - -- of its nature. + | -- | A file whose contents are generated at runtime by user code. AssetGenerated Format a deriving (Eq, Show, Ord, Generic) diff --git a/src/Ema/Server.hs b/src/Ema/Server.hs index 0acc0cc..b2e2eef 100644 --- a/src/Ema/Server.hs +++ b/src/Ema/Server.hs @@ -281,7 +281,7 @@ wsClientShim = ws.onmessage = evt => { console.log("ema: ✍ Patching DOM") - if evt.data.startsWith("REDIRECT ") { + if (evt.data.startsWith("REDIRECT ")) { document.location.href = evt.data.str.slice("REDIRECT ".length); } else { setHtml(document.documentElement, evt.data);