Add header and make phone view better

This commit is contained in:
Wesley Moore 2024-11-24 13:51:51 +10:00
parent 2ded7772c3
commit efc630a09e
No known key found for this signature in database
2 changed files with 21 additions and 7 deletions

View file

@ -130,9 +130,9 @@ markup::define! {
link[rel="stylesheet", type="text/css", href="style.css"]; link[rel="stylesheet", type="text/css", href="style.css"];
} }
body { body {
@Header { title } @Header { title, actor }
main { main {
@for activity in *activities { @for activity in activities.iter().rev() {
@Activity { actor, activity } @Activity { actor, activity }
} }
} }
@ -141,9 +141,11 @@ markup::define! {
} }
} }
Header<'a>(title: &'a str) { Header<'a>(title: &'a str, actor: &'a pleroma::Actor) {
header { header {
h1 { @title } 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() published.strftime("%d %b %Y").to_string()
} }
} }
impl pleroma::Actor {
fn username(&self) -> &str {
self.webfinger
.strip_prefix("acct:")
.unwrap_or(&self.webfinger)
}
}

View file

@ -1,10 +1,7 @@
body { body {
background: #fafbfc; background: #fafbfc;
font-family: sans-serif; font-family: sans-serif;
} margin: 2rem;
main {
padding: 2rem;
} }
hr { hr {
@ -15,6 +12,7 @@ hr {
} }
footer { footer {
margin-top: 2em;
text-align: center; text-align: center;
} }
@ -45,3 +43,9 @@ time {
float: right; float: right;
margin-left: 1em; margin-left: 1em;
} }
@media screen and (max-width: 640px) {
body {
margin: 1rem;
}
}