style
This commit is contained in:
parent
0d2d2fe504
commit
d5326389d5
46
Cargo.lock
generated
46
Cargo.lock
generated
|
@ -19,6 +19,29 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "actix-files"
|
||||||
|
version = "0.6.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0773d59061dedb49a8aed04c67291b9d8cf2fe0b60130a381aab53c6dd86e9be"
|
||||||
|
dependencies = [
|
||||||
|
"actix-http",
|
||||||
|
"actix-service",
|
||||||
|
"actix-utils",
|
||||||
|
"actix-web",
|
||||||
|
"bitflags",
|
||||||
|
"bytes",
|
||||||
|
"derive_more",
|
||||||
|
"futures-core",
|
||||||
|
"http-range",
|
||||||
|
"log",
|
||||||
|
"mime",
|
||||||
|
"mime_guess",
|
||||||
|
"percent-encoding",
|
||||||
|
"pin-project-lite",
|
||||||
|
"v_htmlescape",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.9.0"
|
version = "3.9.0"
|
||||||
|
@ -569,6 +592,12 @@ dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-range"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "httparse"
|
name = "httparse"
|
||||||
version = "1.9.4"
|
version = "1.9.4"
|
||||||
|
@ -679,6 +708,16 @@ version = "0.3.17"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mime_guess"
|
||||||
|
version = "2.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
|
||||||
|
dependencies = [
|
||||||
|
"mime",
|
||||||
|
"unicase",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.7.4"
|
version = "0.7.4"
|
||||||
|
@ -1191,6 +1230,12 @@ dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "v_htmlescape"
|
||||||
|
version = "0.15.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
|
@ -1280,6 +1325,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||||
name = "yuya"
|
name = "yuya"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"actix-files",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
"pulldown-cmark",
|
"pulldown-cmark",
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,4 +7,5 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
|
actix-files = "0.6"
|
||||||
pulldown-cmark = "0.9" # Markdown parser
|
pulldown-cmark = "0.9" # Markdown parser
|
||||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -28,8 +28,8 @@ async fn serve_markdown(file_path: &str) -> impl Responder {
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="sidenav">
|
<div class="sidenav">
|
||||||
<h3><a href="https://www.penwing.org">Summary</a></h3>
|
<h3><a href="/">Summary</a></h3>
|
||||||
<h3><a href="https://www.penwing.org/tools.html">Tools</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#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#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#portainer">dashboard</a>
|
||||||
|
@ -44,10 +44,10 @@ async fn serve_markdown(file_path: &str) -> impl Responder {
|
||||||
<h3><a href="https://www.penwing.org/games.html">my Games</a></h3>
|
<h3><a href="https://www.penwing.org/games.html">my Games</a></h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="topbar">
|
<p class="topbar">
|
||||||
<a href="https://www.penwing.org">Home</a> -
|
<a href="/">Home</a> -
|
||||||
<a href="https://www.penwing.org/tools.html">Tools</a> -
|
<a href="/tools">Tools</a> -
|
||||||
<a href="https://www.penwing.org/art.html">Art</a> -
|
<a href="/art">Art</a> -
|
||||||
<a href="https://www.penwing.org/games.html">Games</a>
|
<a href="/games">Games</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
#CONTENT#
|
#CONTENT#
|
||||||
|
@ -85,6 +85,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
App::new()
|
App::new()
|
||||||
.route("/", web::get().to(summary)) // Route for root
|
.route("/", web::get().to(summary)) // Route for root
|
||||||
.route("/tools", web::get().to(tools)) // Route for tools
|
.route("/tools", web::get().to(tools)) // Route for tools
|
||||||
|
.service(actix_files::Files::new("/assets", "./assets").show_files_listing())
|
||||||
})
|
})
|
||||||
.bind("127.0.0.1:8080")?
|
.bind("127.0.0.1:8080")?
|
||||||
.run()
|
.run()
|
||||||
|
|
Loading…
Reference in a new issue