feat: Added base layout

This commit is contained in:
Cyper committed 2026-02-28 01:24:08 -05:00
1 parent 91ee0abc15
commit d267d1c6c1
5 files changed
+34 -3

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
html,
body {
margin: 0;
padding: 0;
height: 100vh;
}
body {
display: grid;
grid-template-rows: 2rem 1fr 1.5rem;
}
header {
background-color: lightcoral;
}
main {
background-color: lightgreen;
padding: 0 1rem;
}
footer {
background-color: lightskyblue;
display: grid;
place-items: center end;
padding: 0 0.5rem;
}
+1
View File
@@ -0,0 +1 @@
// site.js
+1 -1
View File
@@ -11,7 +11,7 @@ async fn not_found(OriginalUri(uri): OriginalUri) -> AppError {
}
pub fn app() -> Router<Config> {
let static_files = ServeDir::new("static").not_found_service(get(not_found));
let static_files = ServeDir::new("public").not_found_service(get(not_found));
Router::new()
.merge(routes::router())
+3 -1
View File
@@ -14,7 +14,9 @@ async fn main() {
// Build app with shared state
let app = app::app().with_state(config);
let listener = tokio::net::TcpListener::bind("0.0.0.0:7878").await.unwrap();
let app_ip = "0.0.0.0:7878";
let listener = tokio::net::TcpListener::bind(&app_ip).await.unwrap();
println!("Listening on http://localhost:7878");
axum::serve(listener, app).await.unwrap();
}
+2 -1
View File
@@ -16,13 +16,14 @@
rel="stylesheet"
/>
<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/site.css" />
{% block head %}{% endblock %}
</head>
<body>
<header>{% include "components/navbar.html" %}</header>
<main>{% block content %}Content{% endblock %}</main>
<footer>{% block footer %}{% include "components/footer.html" %}{% endblock %}</footer>
<script src="/js/site.js"></script>
{% block scripts %}{% endblock %}
</body>
</html>