Skip to content

Commit

Permalink
fix: applying leptosfmt guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Phosphorus-M committed Dec 30, 2024
1 parent 80e77c8 commit 20b9186
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 63 deletions.
12 changes: 6 additions & 6 deletions src/components/blog_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn BlogContent(
)
>

<StrToIcon v="twitter" class="hover:fill-blue-600"/>
<StrToIcon v="twitter" class="hover:fill-blue-600" />
"Compartir en Twitter"
</a>
<a
Expand All @@ -66,7 +66,7 @@ pub fn BlogContent(
)
>

<StrToIcon v="linkedin" class="hover:fill-blue-600"/>
<StrToIcon v="linkedin" class="hover:fill-blue-600" />
"Compartir en Linkedin"
</a>
</div>
Expand All @@ -75,7 +75,7 @@ pub fn BlogContent(
class="text-sm text-center flex flex-col items-center"
href="#giscus"
>
<StrToIcon v="comment" class="hover:fill-orange-600"/>
<StrToIcon v="comment" class="hover:fill-orange-600" />
"Ver comentarios"
</a>
</div>
Expand Down Expand Up @@ -104,7 +104,7 @@ pub fn BlogContent(
} else {
view! {
<>
<Mdx source=article.content components=components/>
<Mdx source=article.content components=components />
</>
}
}}
Expand Down Expand Up @@ -186,7 +186,7 @@ pub fn ArticleHeader(
{if !social.is_empty() {
view! {
<>
<hr class="h-[0.875rem] w-px bg-gray-700 border-0"/>
<hr class="h-[0.875rem] w-px bg-gray-700 border-0" />
</>
}
} else {
Expand All @@ -197,7 +197,7 @@ pub fn ArticleHeader(
.map(|(net, url)| {
view! {
<a target="_blank" href=url>
<StrToIcon v=net.to_string() size=15/>
<StrToIcon v=net.to_string() size=15 />
</a>
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/card_article.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ pub fn CardArticle(article: Article, is_home: bool) -> impl IntoView {
</a>
<p>{article.date_string}</p>
<div class="text-sm markdown-container">
<MarkdownRender content=description/>
<MarkdownRender content=description />
</div>
<div>
<span class="pt-4 font-bold">Tags:</span>
<TagsList tags=article.tags/>
<TagsList tags=article.tags />
</div>
<div class="flex justify-end items-end">
<a
Expand Down
6 changes: 3 additions & 3 deletions src/components/esta_semana_en_rust/blog_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn BlogContent(#[prop()] article: Article) -> impl IntoView {
{if !social.is_empty() {
view! {
<>
<hr class="h-[0.875rem] w-px bg-gray-700 border-0"/>
<hr class="h-[0.875rem] w-px bg-gray-700 border-0" />
</>
}
} else {
Expand All @@ -66,7 +66,7 @@ pub fn BlogContent(#[prop()] article: Article) -> impl IntoView {
.map(|(net, url)| {
view! {
<a target="_blank" href=url>
<StrToIcon v=net.to_string() size=15/>
<StrToIcon v=net.to_string() size=15 />
</a>
}
})
Expand All @@ -76,7 +76,7 @@ pub fn BlogContent(#[prop()] article: Article) -> impl IntoView {
<span class="text-gray-400 text-sm items-center">{article.date_string}</span>
</div>
<div class="markdown-container prose max-w-none prose-invert">
<Mdx source=article.content components=components/>
<Mdx source=article.content components=components />
</div>
</div>
</div>
Expand Down
28 changes: 14 additions & 14 deletions src/components/esta_semana_en_rust/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ pub fn Layout(
children: Children,
) -> impl IntoView {
view! {
<Html attrs=vec![("lang", "es")] class="bg-slate-800"/>
<Html attrs=vec![("lang", "es")] class="bg-slate-800" />
<Head>
<meta charset="utf-8"/>
<meta charset="utf-8" />
<title>{title.clone()}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta property="og:title" content=title.clone()/>
<meta name="description" content=description.clone()/>
<meta property="og:description" content=description.clone()/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content=title.clone() />
<meta name="description" content=description.clone() />
<meta property="og:description" content=description.clone() />
<meta
property="og:site_name"
content=format!("Blog de Rust Lang en Español {}", get_year())
/>
<meta property="og:url" content="https://rustlang-es.org"/>
<meta property="og:url" content="https://rustlang-es.org" />
<meta
property="og:image"
content=format!("https://blog.rustlang-es.org/articles/{slug}.png")
Expand All @@ -41,14 +41,14 @@ pub fn Layout(
property="twitter:image"
content=format!("https://blog.rustlang-es.org/articles/{slug}.png")
/>
<link rel="canonical" href=format!("https://blog.rustlang-es.org/articles/{slug}")/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@rustlang"/>
<link rel="icon" href="/LogoSegunMichael-134de58fcd9af94e.ico"/>
<link rel="canonical" href=format!("https://blog.rustlang-es.org/articles/{slug}") />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@rustlang" />
<link rel="icon" href="/LogoSegunMichael-134de58fcd9af94e.ico" />
{if cfg!(debug_assertions) {
view! { <link rel="stylesheet" href="/output.css"/> }
view! { <link rel="stylesheet" href="/output.css" /> }
} else {
view! { <link rel="stylesheet" href="https://blog.rustlang-es.org/output.css"/> }
view! { <link rel="stylesheet" href="https://blog.rustlang-es.org/output.css" /> }
}}

<style>
Expand Down Expand Up @@ -82,7 +82,7 @@ pub fn Layout(
// Async is a component from the async_component module.
// It will wrap an async function that returns an IntoView.
<section class="w-full flex flex-col">
<Header/>
<Header />

// <Async view=navigation_bar />
<main class="container mx-auto py-5">{children()}</main>
Expand Down
8 changes: 4 additions & 4 deletions src/components/feature_articles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ pub async fn featured_articles() -> impl IntoView {
});
view! {
<div class="w-full grid lg:grid-cols-divided gap-7">
<EstaSemanaEnRustCard article=esta_semana_en_rust/>
<EstaSemanaEnRustCard article=esta_semana_en_rust />

<AnuncioDeLaComunidadCard article=anuncio_de_la_comunidad/>
<AnuncioDeLaComunidadCard article=anuncio_de_la_comunidad />
</div>
}
}
Expand Down Expand Up @@ -108,7 +108,7 @@ pub fn EstaSemanaEnRustCard(article: Article) -> impl IntoView {
</h2>
</div>
<div class="text-lg lg:text-2xl lg:max-w-[700px] text-balance">
<Mdx components=components source=description/>
<Mdx components=components source=description />
</div>
<div>
<a
Expand Down Expand Up @@ -179,7 +179,7 @@ pub fn AnuncioDeLaComunidadCard(article: Article) -> impl IntoView {
<h2 class="text-2xl font-semibold font-work-sans">{article.title.clone()}</h2>
<p class="text-white/40">{article.date_string}</p>
<div class="text-white/50">
<Mdx components=components source=description/>
<Mdx components=components source=description />
</div>
<div>
<a
Expand Down
2 changes: 1 addition & 1 deletion src/components/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn Header() -> impl IntoView {
<div class="container mx-auto px-4 flex items-center justify-between flex-col lg:flex-row">
<div class="flex justify-between w-full lg:w-auto">
<a href="https://rustlang-es.org" exact=true class="flex items-center gap-x-4">
<LogoRustPageIcon size=80/>
<LogoRustPageIcon size=80 />
</a>
<button
class="lg:hidden"
Expand Down
14 changes: 7 additions & 7 deletions src/components/icons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ pub fn StrToIcon(
match v.as_str() {
"github" => view! {
<>
<GithubIcon size=size class=class/>
<GithubIcon size=size class=class />
</>
},
"twitter" => view! {
<>
<TwitterIcon size=size class=class/>
<TwitterIcon size=size class=class />
</>
},
"website" => view! {
<>
<WebsiteIcon size=size class=class/>
<WebsiteIcon size=size class=class />
</>
},
"next" => view! {
<>
<NextIcon size=size class=class/>
<NextIcon size=size class=class />
</>
},
"linkedin" => view! {
<>
<LinkedinIcon size=size class=class/>
<LinkedinIcon size=size class=class />
</>
},
"comment" => view! {
<>
<CommentIcon size=size class=class/>
<CommentIcon size=size class=class />
</>
},
"rust" => view! {
<>
<LogoRustPageIcon size=size class=class/>
<LogoRustPageIcon size=size class=class />
</>
},
_ => view! { <></> },
Expand Down
32 changes: 16 additions & 16 deletions src/components/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ pub fn Layout(
class="bg-[#fed7aac9] dark:bg-[#131313]/90 bg-center bg-fixed dark:bg-kaku dark:bri dark:bg-cover dark:bg-blend-darken dark:backdrop-blur-xl overflow-x-hidden dark:text-[#e2cea9]"
/>
<Head>
<meta charset="utf-8"/>
<meta charset="utf-8" />
<title>{title.clone()}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fed7aa"/>
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181811"/>
<meta property="og:title" content=title.clone()/>
<meta name="description" content=description.clone()/>
<meta property="og:description" content=description.clone()/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fed7aa" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181811" />
<meta property="og:title" content=title.clone() />
<meta name="description" content=description.clone() />
<meta property="og:description" content=description.clone() />
<meta
property="og:site_name"
content=format!("Blog de Rust Lang en Español {}", get_year())
/>
<meta property="og:url" content="https://rustlang-es.org"/>
<meta property="og:url" content="https://rustlang-es.org" />

{if is_home {
view! {
<>
<link rel="canonical" href="https://blog.rustlang-es.org"/>
<link rel="canonical" href="https://blog.rustlang-es.org" />
<meta
property="og:image"
content=format!("https://rustlang-es.org/{slug}")
Expand All @@ -57,7 +57,7 @@ pub fn Layout(
} else {
view! {
<>
<link rel="canonical" href=format!("https://blog.rustlang-es.org/{slug}")/>
<link rel="canonical" href=format!("https://blog.rustlang-es.org/{slug}") />
<meta
property="og:image"
content=format!("https://blog.rustlang-es.org/{slug}.png")
Expand All @@ -70,13 +70,13 @@ pub fn Layout(
}
}}

<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@rustlang"/>
<link rel="icon" href="https://rustlang-es.org/favicon.ico"/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@rustlang" />
<link rel="icon" href="https://rustlang-es.org/favicon.ico" />
{if cfg!(debug_assertions) {
view! { <link rel="stylesheet" href="/output.css"/> }
view! { <link rel="stylesheet" href="/output.css" /> }
} else {
view! { <link rel="stylesheet" href="https://blog.rustlang-es.org/output.css"/> }
view! { <link rel="stylesheet" href="https://blog.rustlang-es.org/output.css" /> }
}}

<style>
Expand Down Expand Up @@ -110,7 +110,7 @@ pub fn Layout(
// Async is a component from the async_component module.
// It will wrap an async function that returns an IntoView.
<section class="w-full flex flex-col">
<Header/>
<Header />

// <Async view=navigation_bar />
<main class="container mx-auto py-5">{children()}</main>
Expand Down
2 changes: 1 addition & 1 deletion src/components/markdown_render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn MarkdownRender(content: String) -> impl IntoView {

view! {
<>
<Mdx source=content components=components/>
<Mdx source=content components=components />
</>
}
}
8 changes: 4 additions & 4 deletions src/components/pagination_buttons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ pub fn PaginationButtons(
view! {
<>
<Show when=move || show_prev_page_button fallback=|| ()>
<PreviousPageButton page=current_page/>
<PreviousPageButton page=current_page />
</Show>
<Show when=move || show_next_page_button fallback=|| ()>
<NextPageButton page=current_page/>
<NextPageButton page=current_page />
</Show>
</>
}
Expand All @@ -49,7 +49,7 @@ pub fn PreviousPageButton(page: Option<usize>) -> impl IntoView {
href=previous_page
class="bg-orange-500 hover:bg-orange-600 text-white font-semibold py-2 px-4 rounded flex items-center justify-between gap-2"
>
<StrToIcon v="next" class="fill-white rotate-180" size=16/>
<StrToIcon v="next" class="fill-white rotate-180" size=16 />
"Pagina anterior"
</a>
</>
Expand All @@ -68,7 +68,7 @@ pub fn NextPageButton(page: Option<usize>) -> impl IntoView {
class="bg-orange-500 hover:bg-orange-600 text-white font-semibold py-2 px-4 rounded flex items-center justify-between gap-2"
>
"Siguiente pagina"
<StrToIcon v="next" class="fill-white" size=16/>
<StrToIcon v="next" class="fill-white" size=16 />
</a>
</>
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/article_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn ArticlePage(article: Article) -> impl IntoView {
description=description
slug=format!("articles/{}", article.slug.clone())
>
<BlogContent is_html=article.devto article=article/>
<BlogContent is_html=article.devto article=article />
</Layout>
<div id="giscus" class="giscus max-w-5xl mx-auto"></div>
<script
Expand Down
2 changes: 1 addition & 1 deletion src/pages/esta_semana_en_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn EstaSemanaEnRust(article: Article) -> impl IntoView {
view! {
<>
<Layout title=title description=description slug=article.slug.clone()>
<BlogContent article=article/>
<BlogContent article=article />
</Layout>
<script
src="https://giscus.app/client.js"
Expand Down
6 changes: 3 additions & 3 deletions src/pages/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn Homepage(
"Revisa que esta pasando en la comunidad de Rust Lang en Español."
</p>
{if show_featured {
view! { <Async view=featured_articles/> }
view! { <Async view=featured_articles /> }
} else {
view! { <></> }.into_view()
}}
Expand All @@ -49,10 +49,10 @@ pub fn Homepage(
</h1>
</div>
<div class="w-[50%] flex justify-end items-center gap-4">
<PaginationButtons hide=hide_pagination current_page=page max_page/>
<PaginationButtons hide=hide_pagination current_page=page max_page />
</div>
</div>
<GridOfArticles articles=articles is_home=show_featured/>
<GridOfArticles articles=articles is_home=show_featured />
</Layout>
}
}
Expand Down

0 comments on commit 20b9186

Please sign in to comment.