From 4e8d854f9658836dde711c6c4ecac256047a0367 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 15:22:56 -0700 Subject: [PATCH 01/13] fix(nix): add nodejs to packages --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 6895172..ca90778 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ rustToolchain # WASM tools + nodejs tailwindcss_4 wasm-bindgen-cli_0_2_126 From 970229e22522224f0053345d364ef04411c7fef8 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 16:17:16 -0700 Subject: [PATCH 02/13] fix(makefile): just check this project --- Makefile.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index bafe7d9..87d0d28 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -24,14 +24,14 @@ args = ["fmt", "--all"] [tasks.fmt-all] script = ''' -leptosfmt . +leptosfmt src cargo fmt --all cargo clippy --fix --features ssr -- -D warnings ''' [tasks.check] script = ''' -leptosfmt --check . +leptosfmt --check src cargo fmt --all --check cargo clippy --features ssr -- -D warnings ''' @@ -39,7 +39,7 @@ cargo clippy --features ssr -- -D warnings [tasks.leptos-format] install_crate = "leptosfmt" command = "leptosfmt" -args = ["."] +args = ["src"] [tasks.format] dependencies = ["cargo-format", "leptos-format"] From dfefacb3109332c2d6e54b6c139d0d9bc4766dd0 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 16:36:51 -0700 Subject: [PATCH 03/13] update submodules --- design-system-components | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-system-components b/design-system-components index 3483e05..0ee80d7 160000 --- a/design-system-components +++ b/design-system-components @@ -1 +1 @@ -Subproject commit 3483e05f8b354ef3ee01f2e8113b98b3324e9851 +Subproject commit 0ee80d7739b8068614ea4f6c5dbbedd99627df1b From 2cee68a4d08b34f4d7c99361555fd5966a6017a2 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 16:42:35 -0700 Subject: [PATCH 04/13] fix(contributors): WHOOOOOOO DOOO THIS --- src/components/contributors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/contributors.rs b/src/components/contributors.rs index d7a52eb..bf7dcd7 100644 --- a/src/components/contributors.rs +++ b/src/components/contributors.rs @@ -54,7 +54,7 @@ pub fn Contributors() -> impl IntoView { - }; + } }) .collect_view(); @@ -74,7 +74,7 @@ pub fn Contributors() -> impl IntoView {
- {{ contributors_list }} + {contributors_list}
From 5b7a575b763fa830748938f23d2510c815ca697f Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 20:31:41 -0700 Subject: [PATCH 05/13] update submodules --- design-system-components | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design-system-components b/design-system-components index 0ee80d7..73d2708 160000 --- a/design-system-components +++ b/design-system-components @@ -1 +1 @@ -Subproject commit 0ee80d7739b8068614ea4f6c5dbbedd99627df1b +Subproject commit 73d27082b5521b93d402b0e1d17264eee98c609e From f2fcdde57cf90828daafe62e37899d25818c9b94 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 20:43:04 -0700 Subject: [PATCH 06/13] refactor(communities): move repeated code to an array --- src/components/other_communities.rs | 256 +++++++++++----------------- 1 file changed, 100 insertions(+), 156 deletions(-) diff --git a/src/components/other_communities.rs b/src/components/other_communities.rs index 96f02cf..2a47810 100644 --- a/src/components/other_communities.rs +++ b/src/components/other_communities.rs @@ -1,17 +1,114 @@ use leptos::prelude::*; +use leptos_router::{NavigateOptions, hooks::use_navigate}; use rustlanges_components::{ avatar::Avatar, - button::{Button, Variant as ButtonVariant}, + button::{Button, Variant as ButtonVariant, button_class}, card::Card, chip::{Chip, Variant as ChipVariant}, - icons::Telegram, + icons::IconVariant, input::{Filter, InputSearch}, }; type ResourceAlias = Vec; +// TODO(@Lemin-n): quitar el pub, please +struct Community { + pub logo: &'static str, + pub name: &'static str, + pub country: &'static str, + pub description: &'static str, + pub link: Option<(&'static str, IconVariant)>, +} + +const COMMUNITIES: [Community; 7] = [ + Community { + name: "Rust Colombia", + country: "Colombia", + description: "Comunidad de Rust con dos sedes, en Medellín y en Bogotá", + logo: "https://rustlang-es.org/gen_assets/rust-colombia.webp", + link: Some(("https://discord.gg/krm22PuDVw", IconVariant::Discord)), + }, + Community { + name: "Rust Venezuela", + country: "Venezuela duh", + description: "Venezuela dih", + logo: "https://rustlang-es.org/gen_assets/rust-venezuela.webp", + link: Some(("https://t.me/rustlangVE", IconVariant::Telegram)), + }, + Community { + name: "Rust Argentina", + country: "Argentina claro", + description: "Anteriormente Rust Argentina, hoy una comunidad internacional", + logo: "https://rustlang-es.org/gen_assets/rust-argentina.webp", + link: Some(("https://t.me/rust_lang_es", IconVariant::Telegram)), + }, + Community { + name: "Rust Ecuador", + country: "Ecuador", + description: "¡Comunidad de Rust en Ecuador!", + logo: "https://rustlang-es.org/gen_assets/rust_ecuador.webp", + link: Some(("https://t.me/rustecuador", IconVariant::Telegram)), + }, + Community { + name: "Rust MX", + country: "Mexico", + description: "¡Comunidad de Rust en Mexico!", + logo: "https://rustlang-es.org/gen_assets/RustMX-min.webp", + link: Some(("https://t.me/RustMX", IconVariant::Telegram)), + }, + Community { + name: "Bcn Rust", + country: "España", + description: "Comunidad de Rust en Barcelona", + logo: "https://rustlang-es.org/gen_assets/RustBCN.webp", + link: Some(("https://discord.gg/DeZKCCyMcq", IconVariant::Discord)), + }, + Community { + name: "Rust Perú", + country: "Perú", + description: "¡Comunidad de Rust en Perú!", + logo: "https://rustlang-es.org/gen_assets/rust-peru.webp", + link: Some(("https://peru.rustlang-es.org/", IconVariant::Link)), + }, +]; + #[allow(non_snake_case)] pub fn OtherCommunities() -> impl IntoView { + let communities = COMMUNITIES.map(|community| { + let button_link = community.link.map(|(link, link_icon)| { + view! { + + {link_icon.to_view()} + + } + }); + + view! { +
+ +
+
+
+ {button_link} +
+

{community.name}

+ +

+ {community.description} +

+
+
+
+
+ } + }); + view! {
@@ -26,160 +123,7 @@ pub fn OtherCommunities() -> impl IntoView {
- -
- -
-
-
-
-

"Rust Colombia"

- -

- "Comunidad de Rust con dos sedes, en Medellín y en Bogotá" -

-
-
-
-
- -
- -
-
-
-
-

"Rust Venezuela"

- -
-
-
-
- -
- -
-
-
-
-

"Rust Argentina"

- -

- "Anteriormente Rust Argentina, hoy una comunidad internacional" -

-
-
-
-
- -
- -
-
-
-
-

"Rust Ecuador"

- -

- "¡Comunidad de Rust en Ecuador!" -

-
-
-
-
- -
- -
-
-
-
-

"Rust MX"

- -

- "¡Comunidad de Rust en Mexico!" -

-
-
-
-
- -
- -
-
-
-
-

"Rust Perú"

- -

- "¡Comunidad de Rust en Perú!" -

-
-
-
-
- + {communities}
From c969330a26304c638a29692c0212677614959db3 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sat, 19 Sep 2026 20:48:50 -0700 Subject: [PATCH 07/13] fix(workflow): use cargo-binstall for leptosfmt --- .github/workflows/clippy.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index aa1eaf9..43013ae 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -45,17 +45,9 @@ jobs: toolchain: nightly override: true components: clippy - - name: Cache .cargo and target - uses: actions/cache@v4 - with: - path: | - ~/.cargo - key: ${{ runner.os }}-cargo-leptos-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-leptos-${{ hashFiles('**/Cargo.lock') }} - ${{ runner.os }}-cargo-leptos + - uses: cargo-bins/cargo-binstall@main - name: Install LeptosFmt - run: cargo install leptosfmt --version 0.1.33 + run: cargo binstall --disable-telemetry --no-confirm leptosfmt --version 0.1.33 - name: Check LeptosFmt run: leptosfmt --check src From 3d27f088c6d14cb3360188d28226cab3589293e6 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sun, 20 Sep 2026 02:12:38 -0700 Subject: [PATCH 08/13] refactor: sponsors bricks section --- Cargo.lock | 10 +- Cargo.toml | 2 + src/components/icons/mod.rs | 2 + src/components/icons/sponsor_block.rs | 34 +++ src/components/our_sponsors.rs | 316 ++++++++++++-------------- src/components/sponsor_block.rs | 152 ++++++++++--- 6 files changed, 315 insertions(+), 201 deletions(-) create mode 100644 src/components/icons/sponsor_block.rs diff --git a/Cargo.lock b/Cargo.lock index a3b4415..32e7c4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,7 +72,7 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", - "rand 0.10.2", + "rand 0.10.3", "sha1", "smallvec", "tokio", @@ -2329,7 +2329,7 @@ dependencies = [ "bytes", "getrandom 0.4.3", "lru-slab", - "rand 0.10.2", + "rand 0.10.3", "rand_pcg", "ring", "rustc-hash", @@ -2411,9 +2411,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" dependencies = [ "chacha20", "getrandom 0.4.3", @@ -2626,11 +2626,13 @@ dependencies = [ "actix-files", "actix-web", "console_error_panic_hook", + "getrandom 0.4.3", "leptos", "leptos-use", "leptos_actix", "leptos_meta", "leptos_router", + "rand 0.10.3", "reqwest", "rustlanges-components", "rusty-hook", diff --git a/Cargo.toml b/Cargo.toml index ce4ba52..83c9de7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,8 @@ reqwest = { version = "0.13.4", features = [ rustlanges-components = { path="design-system-components", features = ["leptos"] } leptos-use = { version = "0.19.0", features = [] } console_error_panic_hook = { version = "0.1.7", optional = true } +rand = "0.10.3" +getrandom = { version = "0.4.3", features = ["wasm_js"] } # leptos_theme = "0.1.2" [features] diff --git a/src/components/icons/mod.rs b/src/components/icons/mod.rs index 0349f17..f94e075 100644 --- a/src/components/icons/mod.rs +++ b/src/components/icons/mod.rs @@ -5,6 +5,7 @@ mod linkedin_icon; mod location_icon; mod logo_rust_page; mod next; +mod sponsor_block; mod telegram_icon; mod twitter_icon; mod web_icon; @@ -17,6 +18,7 @@ pub use github_icon::*; pub use linkedin_icon::*; pub use location_icon::*; pub use next::*; +pub use sponsor_block::*; pub use telegram_icon::*; pub use twitter_icon::*; diff --git a/src/components/icons/sponsor_block.rs b/src/components/icons/sponsor_block.rs new file mode 100644 index 0000000..51ae05f --- /dev/null +++ b/src/components/icons/sponsor_block.rs @@ -0,0 +1,34 @@ +use leptos::prelude::*; + +#[component] +pub fn SponsorBlockIcon(#[prop(optional)] class: String) -> impl IntoView { + view! { + + + + + + + + } +} diff --git a/src/components/our_sponsors.rs b/src/components/our_sponsors.rs index 70e3524..c5d6a27 100644 --- a/src/components/our_sponsors.rs +++ b/src/components/our_sponsors.rs @@ -1,6 +1,151 @@ use leptos::prelude::*; -use crate::components::sponsor_block::SponsorBlock; +use crate::components::sponsor_block::{SponsorBlock, SponsorVariant}; + +struct SponsorDef { + variant: SponsorVariant, + + img: &'static str, + alt: &'static str, + class: &'static str, +} + +impl Default for SponsorDef { + fn default() -> Self { + Self { + variant: SponsorVariant::default(), + img: Default::default(), + alt: Default::default(), + class: "object-contain w-full h-full", + } + } +} + +enum SponsorBrick { + Sponsor(&'static str), + Empty(&'static str), + Space(&'static str), +} + +fn sponsors() -> impl IntoView { + use SponsorVariant::*; + + let mut sponsors_buf = vec![ + SponsorDef { + variant: Black, + img: "/assets/sponsors/sysarmy.webp", + alt: "SysArmy", + ..Default::default() + }, + SponsorDef { + variant: White, + img: "/assets/new/sponsors/testing-bolivia.png", + alt: "Testing Bolivia", + class: "mix-blend-difference", + }, + SponsorDef { + variant: Custom("#00c39d"), + img: "/assets/new/sponsors/frontendcafe.png", + alt: "FrontendCafe", + class: "shadow-frontendcafe w-full h-full object-contain", + }, + SponsorDef { + variant: Custom("#193270"), + img: "/assets/new/sponsors/universidad_nur.png", + alt: "Universidad Nur", + ..Default::default() + }, + SponsorDef { + variant: Black, + img: "/assets/sponsors/shuttle.webp", + alt: "ShuttleRS", + class: "mix-blend-difference", + }, + SponsorDef { + variant: Primary, + img: "/assets/new/sponsors/cloudflare.svg", + alt: "Cloudflare", + ..Default::default() + }, + SponsorDef { + variant: Custom("#051024"), + img: "/assets/new/sponsors/crabnebula.svg", + alt: "Crabnebula", + class: "mix-blend-difference object-contain w-full h-full", // -mt-3 + }, + SponsorDef { + variant: Custom("var(--color-neutral-950)"), + img: "/assets/new/sponsors/tauri-logo.png", + alt: "Tauri", + ..Default::default() + }, + SponsorDef { + variant: White, + img: "/assets/new/sponsors/aws.svg", + alt: "Amazon Web Services", + ..Default::default() + }, + ]; + + sponsors_buf.reverse(); + + const SPONSOR_BRICKS: usize = 26; + + const BRICKS: [SponsorBrick; SPONSOR_BRICKS] = [ + SponsorBrick::Sponsor("col-start-2 md:col-start-4"), + SponsorBrick::Empty(""), + SponsorBrick::Sponsor(""), + SponsorBrick::Space("hidden md:block lg:block"), + SponsorBrick::Space("hidden md:block lg:hidden"), + SponsorBrick::Sponsor(""), + SponsorBrick::Empty("lg:col-start-2"), + SponsorBrick::Space("block sm:hidden md:hidden lg:block"), + SponsorBrick::Sponsor("col-start-3 sm:col-start-[unset]"), + SponsorBrick::Space("hidden md:block lg:hidden"), + SponsorBrick::Empty("md:col-start-3 lg:col-start-[unset]"), + SponsorBrick::Sponsor("sm:col-start-3 md:col-start-[unset]"), + SponsorBrick::Empty(""), + SponsorBrick::Sponsor(""), + SponsorBrick::Empty("col-start-4 sm:col-start-[unset]"), + SponsorBrick::Sponsor(""), + SponsorBrick::Empty("col-start-2 sm:col-start-[unset]"), + SponsorBrick::Sponsor(""), + SponsorBrick::Empty("sm:col-start-2 md:col-start-[unset]"), + SponsorBrick::Space(""), + SponsorBrick::Sponsor("md:col-start-2 lg:col-start-3"), + SponsorBrick::Empty("col-start-3 md:col-start-[unset]"), + SponsorBrick::Space("hidden md:hidden lg:block"), + SponsorBrick::Empty(""), + SponsorBrick::Empty("hidden sm:block"), + SponsorBrick::Empty("hidden lg:block"), + ]; + + // Get a top-to-down zindex + let mut next_id = SPONSOR_BRICKS + 1; + let mut next_id = move || { + next_id -= 1; + next_id + }; + + BRICKS.map(|b| match b { + SponsorBrick::Sponsor(c) if let Some(sponsor) = sponsors_buf.pop() => { + view! { + + sponsor.alt + + } + } + .into_any(), + SponsorBrick::Sponsor(c) | SponsorBrick::Empty(c) => view! { } + .into_any(), + SponsorBrick::Space(c) => view! {
} + .into_any(), + }) +} #[component] pub fn OurSponsorsSection() -> impl IntoView { @@ -18,170 +163,11 @@ pub fn OurSponsorsSection() -> impl IntoView {
-
- - - SysArmy - - - -
-
- - Testing Bolivia - - - - - FrontendCafe - - - -
-
- - Universidad Nur - - - - ShuttleRS - - - // End mobile - - -
-
- - Cloudflare - - - - Crabnebula - - - Tauri - - - // End mobile - -
-
- - FrontendCafe - - - - Amazon Web Services - +
+ {sponsors}
diff --git a/src/components/sponsor_block.rs b/src/components/sponsor_block.rs index b862a60..e933317 100644 --- a/src/components/sponsor_block.rs +++ b/src/components/sponsor_block.rs @@ -1,40 +1,128 @@ +use std::cell::RefCell; + use leptos::prelude::*; +use rand::seq::SliceRandom; +use wasm_bindgen::UnwrapThrowExt; + +use crate::components::icons::SponsorBlockIcon; + +const GHOST_DEBUG: bool = false; + +#[derive(Default, Clone, Copy, PartialEq, Eq)] +pub enum SponsorVariant { + #[default] + Primary, + Secondary, + Tertiary, + Quaternary, + Black, + White, + Custom(&'static str), +} + +impl SponsorVariant { + pub fn random_colored() -> Self { + thread_local! { + static COLOR_DISTRIBUTION: RefCell> = RefCell::new(Vec::new()); + } + + COLOR_DISTRIBUTION.with_borrow_mut(|c| { + if let Some(color) = c.pop() { + color + } else { + *c = vec![ + Self::Primary, + Self::Secondary, + Self::Tertiary, + Self::Quaternary, + Self::Primary, + Self::Secondary, + Self::Tertiary, + Self::Quaternary, + ]; + + c.shuffle(&mut rand::rng()); + + c.pop().expect_throw("Just filled up") + } + }) + } +} #[component] pub fn SponsorBlock( - #[prop(into, default = "fill-primary-500")] class: &'static str, + #[prop(into, optional)] class: &'static str, + #[prop(optional)] variant: SponsorVariant, + #[prop(optional)] index: usize, #[prop(optional)] children: Option, ) -> impl IntoView { + let (variant_custom, variant_class) = match variant { + SponsorVariant::Primary => ( + None, + if GHOST_DEBUG { + "text-primary-500/5" + } else { + "text-primary-500" + }, + ), + SponsorVariant::Secondary => ( + None, + if GHOST_DEBUG { + "text-secondary-500/5" + } else { + "text-secondary-500" + }, + ), + SponsorVariant::Tertiary => ( + None, + if GHOST_DEBUG { + "text-primary-200/5" + } else { + "text-primary-200" + }, + ), + SponsorVariant::Quaternary => ( + None, + if GHOST_DEBUG { + "text-secondary-300/5" + } else { + "text-secondary-300" + }, + ), + SponsorVariant::Black => ( + None, + if GHOST_DEBUG { + "text-black/5" + } else { + "text-black" + }, + ), + SponsorVariant::White => ( + None, + if GHOST_DEBUG { + "text-white/5" + } else { + "text-white" + }, + ), + SponsorVariant::Custom(s) => (Some(s), "text-(--custom-color)"), + }; + view! { -
-
{children.map(|v| v())}
- - - - - - - -
- } + +
+ {children.map(|v| v())} +
+ +
+ }.into_any() } From 64b6766239464207d5504bfb450051713978449a Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sun, 20 Sep 2026 02:17:43 -0700 Subject: [PATCH 09/13] fix(ci): run style checks on PRs --- .github/workflows/clippy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 43013ae..a9e7c6b 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -2,6 +2,7 @@ name: clippy on: workflow_dispatch: pull_request: + branches: [main, riir] types: - ready_for_review From 27b58d8874fa1f39f6cd787613c5f35aa8ff5280 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sun, 20 Sep 2026 02:20:28 -0700 Subject: [PATCH 10/13] style: fix fmt + clippy lints --- src/components/other_communities.rs | 3 +-- src/components/sponsor_block.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/other_communities.rs b/src/components/other_communities.rs index 2a47810..a760ecb 100644 --- a/src/components/other_communities.rs +++ b/src/components/other_communities.rs @@ -1,8 +1,7 @@ use leptos::prelude::*; -use leptos_router::{NavigateOptions, hooks::use_navigate}; use rustlanges_components::{ avatar::Avatar, - button::{Button, Variant as ButtonVariant, button_class}, + button::{Variant as ButtonVariant, button_class}, card::Card, chip::{Chip, Variant as ChipVariant}, icons::IconVariant, diff --git a/src/components/sponsor_block.rs b/src/components/sponsor_block.rs index e933317..fd248f0 100644 --- a/src/components/sponsor_block.rs +++ b/src/components/sponsor_block.rs @@ -23,7 +23,7 @@ pub enum SponsorVariant { impl SponsorVariant { pub fn random_colored() -> Self { thread_local! { - static COLOR_DISTRIBUTION: RefCell> = RefCell::new(Vec::new()); + static COLOR_DISTRIBUTION: RefCell> = const {RefCell::new(Vec::new())}; } COLOR_DISTRIBUTION.with_borrow_mut(|c| { From 71353b70a4362dbacee20474d395acec688065c6 Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sun, 20 Sep 2026 02:28:49 -0700 Subject: [PATCH 11/13] tweaks I didn't realize --- src/components/our_sponsors.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/components/our_sponsors.rs b/src/components/our_sponsors.rs index c5d6a27..c244ddb 100644 --- a/src/components/our_sponsors.rs +++ b/src/components/our_sponsors.rs @@ -2,6 +2,7 @@ use leptos::prelude::*; use crate::components::sponsor_block::{SponsorBlock, SponsorVariant}; +#[derive(Default)] struct SponsorDef { variant: SponsorVariant, @@ -10,17 +11,6 @@ struct SponsorDef { class: &'static str, } -impl Default for SponsorDef { - fn default() -> Self { - Self { - variant: SponsorVariant::default(), - img: Default::default(), - alt: Default::default(), - class: "object-contain w-full h-full", - } - } -} - enum SponsorBrick { Sponsor(&'static str), Empty(&'static str), @@ -42,12 +32,14 @@ fn sponsors() -> impl IntoView { img: "/assets/new/sponsors/testing-bolivia.png", alt: "Testing Bolivia", class: "mix-blend-difference", + ..Default::default() }, SponsorDef { variant: Custom("#00c39d"), img: "/assets/new/sponsors/frontendcafe.png", alt: "FrontendCafe", class: "shadow-frontendcafe w-full h-full object-contain", + ..Default::default() }, SponsorDef { variant: Custom("#193270"), @@ -60,6 +52,7 @@ fn sponsors() -> impl IntoView { img: "/assets/sponsors/shuttle.webp", alt: "ShuttleRS", class: "mix-blend-difference", + ..Default::default() }, SponsorDef { variant: Primary, @@ -71,7 +64,7 @@ fn sponsors() -> impl IntoView { variant: Custom("#051024"), img: "/assets/new/sponsors/crabnebula.svg", alt: "Crabnebula", - class: "mix-blend-difference object-contain w-full h-full", // -mt-3 + class: "mix-blend-difference", }, SponsorDef { variant: Custom("var(--color-neutral-950)"), From defea88c4b3fb60a2c0c6e7d2add424105383cec Mon Sep 17 00:00:00 2001 From: Brayan-724 Date: Sun, 20 Sep 2026 02:43:12 -0700 Subject: [PATCH 12/13] docs: going to sleep ZzzZzzZzz --- src/components/our_sponsors.rs | 38 +++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/components/our_sponsors.rs b/src/components/our_sponsors.rs index c244ddb..04bc8f5 100644 --- a/src/components/our_sponsors.rs +++ b/src/components/our_sponsors.rs @@ -1,4 +1,4 @@ -use leptos::prelude::*; +use leptos::{leptos_dom::logging::console_warn, prelude::*}; use crate::components::sponsor_block::{SponsorBlock, SponsorVariant}; @@ -80,6 +80,8 @@ fn sponsors() -> impl IntoView { }, ]; + // Sponsors will be "popped" from the buffer, so reverse it + // to get the same order as written sponsors_buf.reverse(); const SPONSOR_BRICKS: usize = 26; @@ -120,7 +122,7 @@ fn sponsors() -> impl IntoView { next_id }; - BRICKS.map(|b| match b { + let view = BRICKS.map(|b| match b { SponsorBrick::Sponsor(c) if let Some(sponsor) = sponsors_buf.pop() => { view! { @@ -133,11 +135,29 @@ fn sponsors() -> impl IntoView { } } .into_any(), + // If there's no more sponsors, just show it as random empty brick. + // This allows to design and assign spaces to sponsors even if not enough SponsorBrick::Sponsor(c) | SponsorBrick::Empty(c) => view! { } .into_any(), + // Reserve an entire brick. + // Consult "What the hell???" section (below) to know more about this. SponsorBrick::Space(c) => view! {
} .into_any(), - }) + }); + + if !sponsors_buf.is_empty() { + console_warn(&format!( + "{} Sponsors left. Some sponsors are not rendered: {}", + sponsors_buf.len(), + sponsors_buf + .into_iter() + .map(|s| s.alt) + .collect::>() + .join(", ") + )); + } + + view } #[component] @@ -156,9 +176,17 @@ pub fn OurSponsorsSection() -> impl IntoView {
+ // What the hell??? + // R: The grid is composed from every brick section (each brick's top-connections) + // to align correctly in any™ position a brick is located. The cols are just an + // arbritrary amount of bricks that looks good in each breakpoint.
{sponsors}
From b32611ded803c9a122359784c914a8752c6fadff Mon Sep 17 00:00:00 2001 From: MarioYellowy Date: Sun, 20 Sep 2026 11:33:25 -0600 Subject: [PATCH 13/13] fix(clippy): unnecessary default in some sponsors --- src/components/our_sponsors.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/our_sponsors.rs b/src/components/our_sponsors.rs index 04bc8f5..922eeba 100644 --- a/src/components/our_sponsors.rs +++ b/src/components/our_sponsors.rs @@ -32,14 +32,12 @@ fn sponsors() -> impl IntoView { img: "/assets/new/sponsors/testing-bolivia.png", alt: "Testing Bolivia", class: "mix-blend-difference", - ..Default::default() }, SponsorDef { variant: Custom("#00c39d"), img: "/assets/new/sponsors/frontendcafe.png", alt: "FrontendCafe", class: "shadow-frontendcafe w-full h-full object-contain", - ..Default::default() }, SponsorDef { variant: Custom("#193270"), @@ -52,7 +50,6 @@ fn sponsors() -> impl IntoView { img: "/assets/sponsors/shuttle.webp", alt: "ShuttleRS", class: "mix-blend-difference", - ..Default::default() }, SponsorDef { variant: Primary,