From 48966fa69d66946d72656ba7cadb23cc6c83590a Mon Sep 17 00:00:00 2001 From: danda Date: Wed, 15 May 2024 13:13:44 -0700 Subject: [PATCH] chore: include head html component in all pages Moves common .. tags into componenents/head.html and includes it from all pages. Common elements include: css files, favicon, meta tag(s) --- templates/web/html/components/head.html | 4 +++ templates/web/html/page/block_info.html | 4 +-- templates/web/html/page/not_found.html | 4 +-- templates/web/html/page/root.html | 38 +++++++++++-------------- templates/web/html/page/utxo.html | 4 +-- 5 files changed, 24 insertions(+), 30 deletions(-) create mode 100644 templates/web/html/components/head.html diff --git a/templates/web/html/components/head.html b/templates/web/html/components/head.html new file mode 100644 index 0000000..5084bb5 --- /dev/null +++ b/templates/web/html/components/head.html @@ -0,0 +1,4 @@ + + + + diff --git a/templates/web/html/page/block_info.html b/templates/web/html/page/block_info.html index 8740a5c..a876c4c 100644 --- a/templates/web/html/page/block_info.html +++ b/templates/web/html/page/block_info.html @@ -3,9 +3,7 @@ Neptune Block Explorer: Block Height {{self.block_info.height}} - - - +{{html_escaper::Trusted(include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/templates/web/html/components/head.html")))}} diff --git a/templates/web/html/page/not_found.html b/templates/web/html/page/not_found.html index 82617a7..a69b7ed 100644 --- a/templates/web/html/page/not_found.html +++ b/templates/web/html/page/not_found.html @@ -2,9 +2,7 @@ Neptune Block Explorer: Not Found - - - +{{html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html")))}} diff --git a/templates/web/html/page/root.html b/templates/web/html/page/root.html index f2659d7..872196d 100644 --- a/templates/web/html/page/root.html +++ b/templates/web/html/page/root.html @@ -1,27 +1,23 @@ Neptune Block Explorer: (network: {{self.state.network}}) - - - - - - +{{ html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html"))) }} +
diff --git a/templates/web/html/page/utxo.html b/templates/web/html/page/utxo.html index 1072833..0af0553 100644 --- a/templates/web/html/page/utxo.html +++ b/templates/web/html/page/utxo.html @@ -2,9 +2,7 @@ Neptune Block Explorer: Utxo {{self.index}} - - - +{{html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html")))}}