diff --git a/src/main.rs b/src/main.rs index 1ee05f1..a3b7f7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,9 +130,9 @@ markup::define! { link[rel="stylesheet", type="text/css", href="style.css"]; } body { - @Header { title } + @Header { title, actor } main { - @for activity in *activities { + @for activity in activities.iter().rev() { @Activity { actor, activity } } } @@ -141,9 +141,11 @@ markup::define! { } } - Header<'a>(title: &'a str) { + Header<'a>(title: &'a str, actor: &'a pleroma::Actor) { header { h1 { @title } + p { "This is a static archive of " @actor.username() } + p { @markup::raw(&actor.summary) } } } @@ -200,3 +202,11 @@ impl pleroma::Activity { published.strftime("%d %b %Y").to_string() } } + +impl pleroma::Actor { + fn username(&self) -> &str { + self.webfinger + .strip_prefix("acct:") + .unwrap_or(&self.webfinger) + } +} diff --git a/style.css b/style.css index 9fcbc73..6d28804 100644 --- a/style.css +++ b/style.css @@ -1,10 +1,7 @@ body { background: #fafbfc; font-family: sans-serif; -} - -main { - padding: 2rem; + margin: 2rem; } hr { @@ -15,6 +12,7 @@ hr { } footer { + margin-top: 2em; text-align: center; } @@ -45,3 +43,9 @@ time { float: right; margin-left: 1em; } + +@media screen and (max-width: 640px) { + body { + margin: 1rem; + } +}