parent
c3d22f8e89
commit
37cd37018f
2 changed files with 8 additions and 2 deletions
|
@ -95,3 +95,9 @@ pub async fn render_page(content: PreEscaped<String>, ctx: RequestContext) -> St
|
|||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub fn favicon(site: &str) -> PreEscaped<String> {
|
||||
html! {
|
||||
img class="h-8 w-8 m-2" src=(format!("/favicon/{site}")) {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ pub async fn index(ctx: RequestContext, arc: &State<WebsiteArchive>) -> StringRe
|
|||
@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" {
|
||||
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) };
|
||||
};
|
||||
|
@ -182,7 +182,7 @@ pub fn gen_search_element(x: &DocEmbedding) -> PreEscaped<String> {
|
|||
hx-get=(format!("/d/{}/{}", x.domain, x.path))
|
||||
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) };
|
||||
(slash_seperator());
|
||||
(gen_path_header(x.path.split('/').collect(), &x.domain, false));
|
||||
|
|
Loading…
Add table
Reference in a new issue