mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
Add phx-track-static
This commit is contained in:
parent
6f012b6796
commit
38655142b0
2 changed files with 8 additions and 2 deletions
|
|
@ -26,6 +26,7 @@ package object scalive extends HtmlTags with HtmlAttrs with ComplexHtmlKeys:
|
||||||
private[scalive] lazy val linkState = dataPhxAttr("link-state")
|
private[scalive] lazy val linkState = dataPhxAttr("link-state")
|
||||||
lazy val click = phxAttrJson("click")
|
lazy val click = phxAttrJson("click")
|
||||||
def value(key: String) = phxAttr(s"value-$key")
|
def value(key: String) = phxAttr(s"value-$key")
|
||||||
|
lazy val trackStatic = htmlAttr("phx-track-static", BooleanAsAttrPresenceCodec)
|
||||||
|
|
||||||
implicit def stringToMod(v: String): Mod = Mod.Content.Text(v)
|
implicit def stringToMod(v: String): Mod = Mod.Content.Text(v)
|
||||||
implicit def htmlElementToMod(el: HtmlElement): Mod = Mod.Content.Tag(el)
|
implicit def htmlElementToMod(el: HtmlElement): Mod = Mod.Content.Tag(el)
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,13 @@ object RootLayout:
|
||||||
headTag(
|
headTag(
|
||||||
metaTag(charset := "utf-8"),
|
metaTag(charset := "utf-8"),
|
||||||
metaTag(nameAttr := "viewport", contentAttr := "width=device-width, initial-scale=1"),
|
metaTag(nameAttr := "viewport", contentAttr := "width=device-width, initial-scale=1"),
|
||||||
scriptTag(defer := true, typ := "text/javascript", src := "/static/app.js"),
|
scriptTag(
|
||||||
linkTag(rel := "stylesheet", href := "/static/app.css"),
|
defer := true,
|
||||||
|
phx.trackStatic := true,
|
||||||
|
typ := "text/javascript",
|
||||||
|
src := "/static/app.js"
|
||||||
|
),
|
||||||
|
linkTag(phx.trackStatic := true, rel := "stylesheet", href := "/static/app.css"),
|
||||||
titleTag("Scalive Example")
|
titleTag("Scalive Example")
|
||||||
),
|
),
|
||||||
bodyTag(
|
bodyTag(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue