separated html
This commit is contained in:
parent
d5326389d5
commit
b5839f6077
45
src/common.html
Normal file
45
src/common.html
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>yuya</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="description" content="Penwing's Website">
|
||||||
|
<link rel="stylesheet" href="/assets/style.css">
|
||||||
|
<link rel="icon" href="/assets/flake.png" type="image/png">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="sidenav">
|
||||||
|
<h3><a href="/">Summary</a></h3>
|
||||||
|
<h3><a href="/tools">Tools</a></h3>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#nginx">proxy</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#cloudflare">domain</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#portainer">dashboard</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#pihole">adblocker</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#searxng">search</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#forgejo">git server</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#jellyfin">streaming</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#stirling">pdf edit</a>
|
||||||
|
<a class="description" href="https://www.penwing.org/tools.html#seafile">storage</a>
|
||||||
|
|
||||||
|
<h3><a href="https://www.penwing.org/art.html">my Art</a></h3>
|
||||||
|
<h3><a href="https://www.penwing.org/games.html">my Games</a></h3>
|
||||||
|
</div>
|
||||||
|
<p class="topbar">
|
||||||
|
<a href="/">Home</a> -
|
||||||
|
<a href="/tools">Tools</a> -
|
||||||
|
<a href="/art">Art</a> -
|
||||||
|
<a href="/games">Games</a>
|
||||||
|
</p>
|
||||||
|
<div class="main">
|
||||||
|
#CONTENT#
|
||||||
|
<hr>
|
||||||
|
<p id="spacer"><br></p>
|
||||||
|
|
||||||
|
<h2 id="epilogue">Epilogue</h2>
|
||||||
|
|
||||||
|
<p>Inspired by the geniuses behind <a href="https://perfectmotherfuckingwebsite.com/">perfectwebsite.com</a>,
|
||||||
|
because a webpage does not have to be heavier than <a href="https://github.com/chrislgarry/Apollo-11">the code that took us to the moon</a>.</p>
|
||||||
|
|
||||||
|
<p>This page is licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body></html>
|
48
src/main.rs
48
src/main.rs
|
@ -17,53 +17,7 @@ async fn serve_markdown(file_path: &str) -> impl Responder {
|
||||||
let html_content = markdown_to_html(&markdown_content);
|
let html_content = markdown_to_html(&markdown_content);
|
||||||
|
|
||||||
// Create the common HTML wrapper
|
// Create the common HTML wrapper
|
||||||
let common_html = r#"
|
let common_html = include_str!("common.html");
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
<title>yuya</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="description" content="Penwing's Website">
|
|
||||||
<link rel="stylesheet" href="/assets/style.css">
|
|
||||||
<link rel="icon" href="/assets/flake.png" type="image/png">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="sidenav">
|
|
||||||
<h3><a href="/">Summary</a></h3>
|
|
||||||
<h3><a href="/tools">Tools</a></h3>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#nginx">proxy</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#cloudflare">domain</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#portainer">dashboard</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#pihole">adblocker</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#searxng">search</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#forgejo">git server</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#jellyfin">streaming</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#stirling">pdf edit</a>
|
|
||||||
<a class="description" href="https://www.penwing.org/tools.html#seafile">storage</a>
|
|
||||||
|
|
||||||
<h3><a href="https://www.penwing.org/art.html">my Art</a></h3>
|
|
||||||
<h3><a href="https://www.penwing.org/games.html">my Games</a></h3>
|
|
||||||
</div>
|
|
||||||
<p class="topbar">
|
|
||||||
<a href="/">Home</a> -
|
|
||||||
<a href="/tools">Tools</a> -
|
|
||||||
<a href="/art">Art</a> -
|
|
||||||
<a href="/games">Games</a>
|
|
||||||
</p>
|
|
||||||
<div class="main">
|
|
||||||
#CONTENT#
|
|
||||||
<hr>
|
|
||||||
<p id="spacer"><br></p>
|
|
||||||
|
|
||||||
<h2 id="epilogue">Epilogue</h2>
|
|
||||||
|
|
||||||
<p>Inspired by the geniuses behind <a href="https://perfectmotherfuckingwebsite.com/">perfectwebsite.com</a>,
|
|
||||||
because a webpage does not have to be heavier than <a href="https://github.com/chrislgarry/Apollo-11">the code that took us to the moon</a>.</p>
|
|
||||||
|
|
||||||
<p>This page is licensed under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a></p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body></html>
|
|
||||||
"#;
|
|
||||||
|
|
||||||
// Replace #CONTENT# placeholder with the actual Markdown HTML content
|
// Replace #CONTENT# placeholder with the actual Markdown HTML content
|
||||||
let page_html = common_html.replace("#CONTENT#", &html_content);
|
let page_html = common_html.replace("#CONTENT#", &html_content);
|
||||||
|
|
Loading…
Reference in a new issue