fix fav
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2024-12-30 22:14:39 +01:00
parent c3d22f8e89
commit 37cd37018f
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 8 additions and 2 deletions

View file

@ -95,3 +95,9 @@ pub async fn render_page(content: PreEscaped<String>, ctx: RequestContext) -> St
) )
.await .await
} }
pub fn favicon(site: &str) -> PreEscaped<String> {
html! {
img class="h-8 w-8 m-2" src=(format!("/favicon/{site}")) {};
}
}

View file

@ -57,7 +57,7 @@ pub async fn index(ctx: RequestContext, arc: &State<WebsiteArchive>) -> StringRe
@for site in websites { @for site in websites {
a href=(format!("/d/{site}")) class="bg-neutral-900 shadow-md rounded-lg hover:bg-neutral-800 bg-gray-1 hover:cursor-pointer transition-all duration-300 flex flex-col items-center justify-center aspect-square max-w-60" { a href=(format!("/d/{site}")) class="bg-neutral-900 shadow-md rounded-lg hover:bg-neutral-800 bg-gray-1 hover:cursor-pointer transition-all duration-300 flex flex-col items-center justify-center aspect-square max-w-60" {
div class="bg-blue-500 text-white rounded-full p-4" { div class="bg-blue-500 text-white rounded-full p-4" {
img class="h-8 w-8" src=(format!("/favicon/{site}")) {}; (favicon(&site))
}; };
p class="mt-4 text-base font-medium" { (site) }; p class="mt-4 text-base font-medium" { (site) };
}; };
@ -182,7 +182,7 @@ pub fn gen_search_element(x: &DocEmbedding) -> PreEscaped<String> {
hx-get=(format!("/d/{}/{}", x.domain, x.path)) hx-get=(format!("/d/{}/{}", x.domain, x.path))
hx-target="#main_content" hx-push-url="true" hx-swap="innerHTML" hx-target="#main_content" hx-push-url="true" hx-swap="innerHTML"
{ {
img class="p-2" src=(format!("/favicon/{}", &x.domain)); (favicon(&x.domain))
a { (x.domain) }; a { (x.domain) };
(slash_seperator()); (slash_seperator());
(gen_path_header(x.path.split('/').collect(), &x.domain, false)); (gen_path_header(x.path.split('/').collect(), &x.domain, false));