add link to source, put footer at bottom of page

This commit is contained in:
Edward Shen 2020-04-17 13:43:53 -04:00
parent 843efc2e62
commit 73f25b9ae8
Signed by: edward
GPG key ID: 19182661E818369F
3 changed files with 17 additions and 4 deletions

View file

@ -121,6 +121,9 @@ fn compile_templates() -> Handlebars {
handlebars handlebars
.register_partial("bunbun_version", env!("CARGO_PKG_VERSION")) .register_partial("bunbun_version", env!("CARGO_PKG_VERSION"))
.unwrap(); .unwrap();
handlebars
.register_partial("bunbun_src", env!("CARGO_PKG_REPOSITORY"))
.unwrap();
macro_rules! register_template { macro_rules! register_template {
[ $( $template:expr ),* ] => { [ $( $template:expr ),* ] => {
$( $(

View file

@ -1,5 +1,4 @@
use crate::{template_args, BunBunError, Route, State}; use crate::{template_args, BunBunError, Route, State};
use actix_web::http::header::ContentType;
use actix_web::web::{Data, Query}; use actix_web::web::{Data, Query};
use actix_web::{get, http::header}; use actix_web::{get, http::header};
use actix_web::{HttpRequest, HttpResponse, Responder}; use actix_web::{HttpRequest, HttpResponse, Responder};

View file

@ -7,6 +7,8 @@
<style type="text/css"> <style type="text/css">
body { body {
display: flex; display: flex;
margin: 0;
min-height: 100vh;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
background-color: #212121; background-color: #212121;
@ -14,11 +16,18 @@
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
} }
h1, p { margin: 0; } h1, p { margin: 0; }
h1 { margin-top: 1rem; }
main { display: flex; } main { display: flex; }
a { color: white; } a { color: white; }
footer { footer {
margin-top: 1rem; display: flex;
color: #444; justify-self: end;
justify-content: space-between;
}
.spacer { flex-grow: 1; }
footer p, footer p a {
margin: 1rem 0.5rem;
color: #555;
} }
</style> </style>
<link rel="search" <link rel="search"
@ -55,7 +64,9 @@
</main> </main>
<p>To view a full list of commands currently available on this instance, check out the <a href="/ls">command list</a>.</p> <p>To view a full list of commands currently available on this instance, check out the <a href="/ls">command list</a>.</p>
</body> </body>
<div class="spacer"></div>
<footer> <footer>
<p>{{> bunbun_version }}</p> <p>{{> bunbun_version }}</p>
<p><a href="{{> bunbun_src }}">Source Code</a></p>
</footer> </footer>
</html> </html>