From b5839f6077800747e916fdd070f49e7f762ac076 Mon Sep 17 00:00:00 2001 From: WanderingPenwing Date: Mon, 2 Sep 2024 01:49:02 +0200 Subject: [PATCH] separated html --- src/common.html | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main.rs | 48 +----------------------------------------------- 2 files changed, 46 insertions(+), 47 deletions(-) create mode 100644 src/common.html diff --git a/src/common.html b/src/common.html new file mode 100644 index 0000000..38b27c1 --- /dev/null +++ b/src/common.html @@ -0,0 +1,45 @@ + + + yuya + + + + + + +
+

Summary

+

Tools

+ proxy + domain + dashboard + adblocker + search + git server + streaming + pdf edit + storage + +

my Art

+

my Games

+
+

+Home - +Tools - +Art - +Games +

+
+#CONTENT# +
+


+ +

Epilogue

+ +

Inspired by the geniuses behind perfectwebsite.com, +because a webpage does not have to be heavier than the code that took us to the moon.

+ +

This page is licensed under CC0

+ +
+ diff --git a/src/main.rs b/src/main.rs index f0eef21..e9f3e9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,53 +17,7 @@ async fn serve_markdown(file_path: &str) -> impl Responder { let html_content = markdown_to_html(&markdown_content); // Create the common HTML wrapper - let common_html = r#" - - - yuya - - - - - - -
-

Summary

-

Tools

- proxy - domain - dashboard - adblocker - search - git server - streaming - pdf edit - storage - -

my Art

-

my Games

-
-

- Home - - Tools - - Art - - Games -

-
- #CONTENT# -
-


- -

Epilogue

- -

Inspired by the geniuses behind perfectwebsite.com, - because a webpage does not have to be heavier than the code that took us to the moon.

- -

This page is licensed under CC0

- -
- - "#; + let common_html = include_str!("common.html"); // Replace #CONTENT# placeholder with the actual Markdown HTML content let page_html = common_html.replace("#CONTENT#", &html_content);