Skip to content

Commit 7485a5b

Browse files
committed
feat: add a new page
1 parent d6328ac commit 7485a5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+751
-556
lines changed

Cargo.lock

+33-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "test-leptos"
2+
name = "rust-lang-es"
33
version = "0.1.0"
44
edition = "2021"
55

assets/roadmap.avif

50.6 KB
Binary file not shown.

assets/roadmap2.avif

33.3 KB
Binary file not shown.

assets/roadmap3.avif

26.2 KB
Binary file not shown.

assets/youtube/dotmyself.avif

5.04 KB
Binary file not shown.

assets/youtube/pineiden.avif

13.5 KB
Binary file not shown.

assets/youtube/piny4man.avif

4.92 KB
Binary file not shown.

assets/youtube/robertohuertasm.avif

7.84 KB
Binary file not shown.

build.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
fs,
44
fs::{DirEntry, Metadata},
55
io::Write,
6-
path::{Path, PathBuf},
6+
path::Path,
77
};
88

99
fn main() {
@@ -34,8 +34,8 @@ fn main() {
3434
path.push(folder.path());
3535

3636
match folder.file_name().to_str().unwrap() {
37-
"comunidades" => generate_comunity(path),
38-
"proyectos" => generate_projects(path),
37+
"comunidades" => generate_comunity(&path),
38+
"proyectos" => generate_projects(&path),
3939
_ => {}
4040
}
4141
}
@@ -55,8 +55,8 @@ fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> std::io::Result
5555
Ok(())
5656
}
5757

58-
fn generate_comunity(path: PathBuf) {
59-
let folders = fs::read_dir(path.as_path()).unwrap();
58+
fn generate_comunity(path: &Path) {
59+
let folders = fs::read_dir(path).unwrap();
6060
let mut comunities = Vec::new();
6161

6262
for file in folders {
@@ -103,16 +103,16 @@ fn generate_comunity(path: PathBuf) {
103103
write!(out, "\n];").unwrap();
104104
}
105105

106-
fn iter_dir(path: PathBuf, mut callback: impl FnMut(DirEntry, Metadata)) {
107-
let folders = fs::read_dir(path.as_path()).unwrap();
106+
fn iter_dir(path: &Path, mut callback: impl FnMut(DirEntry, Metadata)) {
107+
let folders = fs::read_dir(path).unwrap();
108108
for folder in folders {
109109
let folder = folder.unwrap();
110110
let meta = folder.metadata().unwrap();
111111
callback(folder, meta);
112112
}
113113
}
114114

115-
fn generate_projects(path: PathBuf) {
115+
fn generate_projects(path: &Path) {
116116
let mut projects = Vec::new();
117117
iter_dir(path, |folder, meta| {
118118
if meta.is_file() {
@@ -122,7 +122,7 @@ fn generate_projects(path: PathBuf) {
122122
let category = category.to_str().unwrap();
123123

124124
let category = category.to_string();
125-
iter_dir(folder.path(), |file, meta| {
125+
iter_dir(&folder.path(), |file, meta| {
126126
if meta.is_dir() {
127127
return;
128128
}

input.css

+26
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,30 @@
1616
height: 150px;
1717
/* TODO: fix the border made it with drop-shadow */
1818
filter: drop-shadow(5px 5px 0px #ffffff);
19+
}
20+
21+
.image-container img:not(:first-child) {
22+
@apply opacity-60
23+
}
24+
25+
.image-container {
26+
position: relative;
27+
width: 100%;
28+
height: auto;
29+
}
30+
31+
.group:hover > span.badge-container {
32+
@apply first:min-w-28 first:min-h-6 items-center justify-center transition-all transform duration-1000;
33+
}
34+
35+
.group:hover > span.badge-container > span.badge-content {
36+
@apply not-sr-only transition-all transform duration-1000;
37+
}
38+
39+
.list{
40+
@apply grid grid-flow-col auto-cols-min items-center justify-between gap-3 overflow-x-auto snap-x snap-mandatory;
41+
}
42+
43+
.list-container {
44+
@apply min-w-80 md:min-w-[420px];
1945
}

src/app.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use leptos::*;
2-
use leptos_meta::*;
3-
use leptos_router::*;
1+
use leptos::{component, tracing, view, IntoView};
2+
use leptos_meta::{provide_meta_context, Body, Html, Meta, Stylesheet, Title};
3+
use leptos_router::{Router, Routes, StaticParamsMap, StaticRoute};
44

55
use crate::{
66
components::{Footer, Header},
7-
pages::{Communidad, Contributors, Index},
7+
pages::{Aprende, Communidad, Contributors, Index},
88
};
99

1010
#[component]
@@ -65,6 +65,11 @@ pub fn App() -> impl IntoView {
6565
view=Contributors
6666
static_params=move || Box::pin(async move { StaticParamsMap::default() })
6767
/>
68+
<StaticRoute
69+
path="/aprende"
70+
view=Aprende
71+
static_params=move || Box::pin(async move { StaticParamsMap::default() })
72+
/>
6873
<StaticRoute
6974
path="404"
7075
view=Index

src/components/aprende/books.rs

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
use leptos::{IntoView, component, tracing, view};
2+
3+
use crate::components::ButtonLink;
4+
5+
#[component]
6+
pub fn Books(
7+
) -> impl IntoView {
8+
view! {
9+
<section class=" bg-orange-300/30 py-20">
10+
<div class="container mx-auto mb-5">
11+
<h1 class="font-alfa-slab text-3xl sm:text-4xl lg:text-5xl text-center mb-5">
12+
"¡Nuestros Libros!"
13+
</h1>
14+
<p class="max-w-screen-xl mx-auto text-center text-balance text-lg">
15+
"Hemos dedicado tiempo y esfuerzo a adaptar libros al español, estamos orgullosos de compartir estos recursos, esperando que contribuyan al acceso y comprensión de valiosos conocimientos."
16+
</p>
17+
</div>
18+
<div class="flex flex-row justify-center items-center container mx-auto mb-28">
19+
<section class="w-1/2 px-10">
20+
<div class="relative group flex flex-col gap-y-6 border border-black p-2 sm:p-6 bg-orange-100 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] justify-between group transition-all transform">
21+
<span class="absolute top-0 end-0 inline-flex items-center size-3.5 rounded-full border-2 border-white text-xs font-medium transition-all transform -translate-y-1/2 translate-x-1/2 bg-teal-500 dark:border-slate-900 badge-container">
22+
<span class="sr-only text-black badge-content transition-all transform ">
23+
"Recomendado"
24+
</span>
25+
</span>
26+
<h1 class="font-alfa-slab text-xl sm:text-2xl lg:text-3xl text-center mb-5">
27+
"El Lenguaje de Programación Rust"
28+
</h1>
29+
<p class="container mx-auto">
30+
"Cariñosamente conocido como “el libro”, El Lenguaje de Programación Rust te dará una visión del lenguaje desde los principios básicos. Construirás unos cuantos proyectos por el camino y, al final, tendrás una comprensión sólida del lenguaje."
31+
</p>
32+
<div class="mx-auto">
33+
<ButtonLink href="https://rustlanges.github.io/rust-book-es" size="big">
34+
"Ir a “El Libro”"
35+
</ButtonLink>
36+
</div>
37+
</div>
38+
</section>
39+
40+
<section class="w-1/2 px-10">
41+
<div class="group flex flex-col gap-y-6 border border-black p-2 sm:p-6 bg-orange-100 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] transition justify-between">
42+
<span class="absolute top-0 end-0 inline-flex items-center size-3.5 rounded-full border-2 border-white text-xs font-medium transition-all transform -translate-y-1/2 translate-x-1/2 bg-yellow-500 dark:border-slate-900 badge-container">
43+
<span class="sr-only text-black badge-content transition-all transform ">
44+
"¡En Progreso!"
45+
</span>
46+
</span>
47+
<h1 class="font-alfa-slab text-xl sm:text-2xl lg:text-3xl text-center mb-5">
48+
"Rust para C#/.NET Developers"
49+
</h1>
50+
<p class="container mx-auto">
51+
"La guía esta hecha por la misma Microsoft y es para desarrolladores experimentados en C#/.NET que exploran Rust. Ofrece una breve comparación, enlaces a recursos y respuestas rápidas."
52+
</p>
53+
<div class="mx-auto">
54+
<ButtonLink
55+
href="https://rustlanges.github.io/rust-para-dotnet-devs"
56+
size="big"
57+
>
58+
"Ir a la guía"
59+
</ButtonLink>
60+
</div>
61+
</div>
62+
</section>
63+
</div>
64+
65+
<div class="container mx-auto mb-5">
66+
<h1 class="font-alfa-slab text-3xl sm:text-4xl lg:text-5xl text-center mb-5">
67+
"¡Otros Libros!"
68+
</h1>
69+
<p class="max-w-screen-xl mx-auto text-center text-balance text-lg">
70+
"Estos son algunos otros libros que nos interesa compartir con ustedes."
71+
</p>
72+
</div>
73+
<div class="flex flex-row justify-center items-center container mx-auto">
74+
<section class="w-1/2 px-10">
75+
<div class="relative group flex flex-col gap-y-6 border border-black p-2 sm:p-6 bg-orange-100 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] justify-between group transition-all transform">
76+
<h1 class="font-alfa-slab text-xl sm:text-2xl lg:text-3xl text-center mb-5">
77+
"Comprehensive Rust"
78+
</h1>
79+
<p class="container mx-auto">
80+
"Curso gratuito y de código abierto desarrollado por el equipo de Android de Google. Cubre todos los aspectos de Rust, desde la sintaxis básica hasta temas avanzados. Se ven algunos temas especializados como Android, Chromium y Bare-metal."
81+
</p>
82+
<div class="mx-auto">
83+
<ButtonLink
84+
href="https://google.github.io/comprehensive-rust/es/index.html"
85+
size="big"
86+
>
87+
"Ir a Comprehensive Rust"
88+
</ButtonLink>
89+
</div>
90+
</div>
91+
</section>
92+
</div>
93+
</section>
94+
}
95+
}

src/components/aprende/header.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use leptos::{IntoView, component, tracing, view};
2+
3+
4+
#[component]
5+
pub fn HeaderAprende(
6+
) -> impl IntoView {
7+
view! {
8+
<header class="border-b border-b-black/20 bg-orange-100 py-20 flex ">
9+
<div class="container mx-auto">
10+
<h1 class="font-alfa-slab text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">
11+
"Aprende Rust"
12+
</h1>
13+
</div>
14+
</header>
15+
}
16+
}

src/components/aprende/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use mod_use::mod_use;
2+
3+
mod_use![
4+
books,
5+
header,
6+
roadmap,
7+
youtube
8+
];

0 commit comments

Comments
 (0)