chore: include head html component in all pages

Moves common <head>..</head> tags into componenents/head.html and
includes it from all pages.

Common elements include: css files, favicon, meta tag(s)
This commit is contained in:
danda 2024-05-15 13:13:44 -07:00
parent faf303bbdd
commit 48966fa69d
5 changed files with 24 additions and 30 deletions

View File

@ -0,0 +1,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-favicon.png">

View File

@ -3,9 +3,7 @@
<head> <head>
<title>Neptune Block Explorer: Block Height {{self.block_info.height}}</title> <title>Neptune Block Explorer: Block Height {{self.block_info.height}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{html_escaper::Trusted(include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/templates/web/html/components/head.html")))}}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
</head> </head>
<body> <body>

View File

@ -2,9 +2,7 @@
<head> <head>
<title>Neptune Block Explorer: Not Found</title> <title>Neptune Block Explorer: Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html")))}}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
</head> </head>
<body> <body>

View File

@ -1,11 +1,8 @@
<html> <html>
<head> <head>
<title>Neptune Block Explorer: (network: {{self.state.network}})</title> <title>Neptune Block Explorer: (network: {{self.state.network}})</title>
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" /> {{ html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html"))) }}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" /> <script>
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-favicon.png">
<script>
function handle_submit(form) { function handle_submit(form) {
let value = form.height_or_digest.value; let value = form.height_or_digest.value;
var is_digest = value.length == 80; var is_digest = value.length == 80;
@ -20,8 +17,7 @@
window.location.href = uri; window.location.href = uri;
return false; return false;
} }
</script> </script>
</head> </head>
<body> <body>
<header class="container"> <header class="container">

View File

@ -2,9 +2,7 @@
<head> <head>
<title>Neptune Block Explorer: Utxo {{self.index}}</title> <title>Neptune Block Explorer: Utxo {{self.index}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html")))}}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
</head> </head>
<body> <body>