Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Nov 8, 2023
1 parent 7386992 commit 559dffc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions src/main/scala/microsites/layouts/Layout.scala
Expand Up @@ -55,11 +55,13 @@ abstract class Layout(config: MicrositeSettings) {
def render: TypedTag[String]

def commonHead: List[TypedTag[String]] =
List(head(
metas,
favicons,
styles
)) ++ ganalytics4
List(
head(
metas,
favicons,
styles
)
) ++ ganalytics4

val ganalytics: Option[TypedTag[String]] =
if (config.identity.analytics.nonEmpty)
Expand Down Expand Up @@ -209,13 +211,19 @@ abstract class Layout(config: MicrositeSettings) {
val ganalytics4: List[TypedTag[String]] =
if (config.identity.googleAnalytics4.nonEmpty)
List(
script(attr("async") := "async", attr("src") := s"https://www.googletagmanager.com/gtag/js?id=${config.identity.googleAnalytics4}"),
script(
attr("async") := "async",
attr(
"src"
) := s"https://www.googletagmanager.com/gtag/js?id=${config.identity.googleAnalytics4}"
),
script(s"""
|window.dataLayer = window.dataLayer || [];
|function gtag(){dataLayer.push(arguments);}
|gtag('js', new Date());
|gtag('config', '${config.identity.googleAnalytics4}');
""".stripMargin))
""".stripMargin)
)
else Nil

def scripts: List[TypedTag[String]] = {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/microsites/microsites.scala
Expand Up @@ -27,7 +27,7 @@ case class MicrositeIdentitySettings(
twitter: String,
twitterCreator: String,
analytics: String,
googleAnalytics4: String,
googleAnalytics4: String
)

case class MicrositeFileLocations(
Expand Down

0 comments on commit 559dffc

Please sign in to comment.