From 3977533f7270282f1228072937fef219f874deb0 Mon Sep 17 00:00:00 2001 From: esmaeelE Date: Wed, 2 Dec 2026 15:11:21 +0330 Subject: [PATCH] Add light theme toggle to landing page Default the landing page to a light theme, add a dark-theme override, and provide a persisted theme toggle on the generated index page. --- Cargo.lock | 101 ++++++++++++++++++++++++++++++++++++++++++++++ xtask/src/main.rs | 69 ++++++++++++++++++++++++++++--- 2 files changed, 165 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6c15da8..ebe65e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,107 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "ctrlc" +version = "3.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11247e6c4f83c2b15748f4873805483deaa2bbc855e773817c07a9f987f55c62" +dependencies = [ + "dispatch2", + "nix", + "windows-sys", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "nix" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77730ed34f01f4990cb2ea67fec715ecebc6fab9a6396cf83c5529b13f581bdc" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +dependencies = [ + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "xtask" version = "0.1.0" +dependencies = [ + "ctrlc", +] diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 902114c..c970805 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -202,11 +202,29 @@ fn write_landing_page(site: &Path) { Rust Training Books +

🦀 Rust Training Books

Pick the guide that matches your background

@@ -300,6 +339,26 @@ fn write_landing_page(site: &Path) { {cards} + "##