Template
feat: Added base layout
This commit is contained in:
1 parent
91ee0abc15
commit
d267d1c6c1
5 files changed
+34
-3
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
// site.js
|
||||
+1
-1
@@ -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
@@ -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();
|
||||
}
|
||||
@@ -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>
|
||||
Reference in new issue
Block a user