|
1 |
| -use leptos::{component, use_context, view, IntoView, SignalGet}; |
2 |
| -use leptos_meta::{provide_meta_context, Body, Html, Link, Meta, Stylesheet, Title}; |
3 |
| -use leptos_router::{ |
4 |
| - use_location, Router, RouterIntegrationContext, Routes, StaticParamsMap, StaticRoute, |
5 |
| -}; |
| 1 | +use leptos::{component, view, IntoView}; |
| 2 | +use leptos_meta::{provide_meta_context, Body}; |
| 3 | +use leptos_router::{Router, Routes, StaticParamsMap, StaticRoute}; |
6 | 4 |
|
7 | 5 | use crate::{
|
8 |
| - components::{Footer, Header}, |
| 6 | + components::{Footer, HeadInformation, Header}, |
9 | 7 | pages::{Aprende, Communidad, Contributors, Index},
|
10 | 8 | };
|
11 | 9 |
|
12 | 10 | #[component]
|
13 | 11 | pub fn App() -> impl IntoView {
|
14 | 12 | // Provides context that manages stylesheets, titles, meta tags, etc.
|
15 | 13 | provide_meta_context();
|
16 |
| - let (assets_folder, bg_in_dark_mode) = if cfg!(debug_assertions) { |
17 |
| - ("./assets", "dark:bg-kaku-dev") |
18 |
| - } else { |
19 |
| - (".", "dark:bg-kaku") |
20 |
| - }; |
21 |
| - |
22 |
| - let preview = if use_context::<RouterIntegrationContext>() |
23 |
| - .is_some_and(|ctx| ctx.0.location().get().value.contains("/aprende")) |
24 |
| - { |
25 |
| - "aprende_preview.webp" |
| 14 | + let bg_in_dark_mode = if cfg!(debug_assertions) { |
| 15 | + "dark:bg-kaku-dev" |
26 | 16 | } else {
|
27 |
| - "rustlanges_preview.webp" |
| 17 | + "dark:bg-kaku" |
28 | 18 | };
|
29 | 19 |
|
30 | 20 | view! {
|
31 | 21 | <Router>
|
32 |
| - <Html lang="es"/> |
33 |
| - <Meta charset="utf-8"/> |
34 |
| - <Meta name="viewport" content="width=device-width, initial-scale=1"/> |
35 |
| - <Stylesheet id="fonts" href=format!("{}/fonts.css", assets_folder)/> |
36 |
| - <Stylesheet id="leptos" href="/pkg/leptos_start.css"/> |
37 |
| - <Title text="Rust Lang en Español"/> |
38 |
| - <Meta |
39 |
| - name="description" |
40 |
| - content="Únete a nuestra comunidad de Rust en español. Promovemos el aprendizaje y la difusión de Rust, compartiendo conocimientos y proyectos emocionantes." |
41 |
| - /> |
42 |
| - |
43 |
| - <Meta name="og:site_name" content="Rust Lang en Español"/> |
44 |
| - <Meta name="og:title" content="Bienvenidos a Rust Lang en Español"/> |
45 |
| - <Meta |
46 |
| - name="og:description" |
47 |
| - content="Únete a nuestra comunidad de Rust en español. Promovemos el aprendizaje y la difusión de Rust, compartiendo conocimientos y proyectos emocionantes." |
48 |
| - /> |
49 |
| - <Meta name="og:url" content="https://rustlang-es.org"/> |
50 |
| - <Meta name="og:image" content=format!("https://rustlang-es.org/{preview}")/> |
51 |
| - <Meta name="twitter:image" content=format!("https://rustlang-es.org/{preview}")/> |
52 |
| - <Meta name="twitter:card" content="summary_large_image"/> |
53 |
| - <Meta name="twitter:site" content="@rustlang"/> |
54 |
| - <Meta |
55 |
| - name="google-site-verification" |
56 |
| - content="OntIe2SKuQalaapGvxdded9tU4G2p57h0A6e0Rkoni0" |
57 |
| - /> |
58 |
| - |
59 |
| - { |
60 |
| - let location = use_location().pathname; |
61 |
| - view! { |
62 |
| - <Link |
63 |
| - rel="canonical" |
64 |
| - href=format!("https://www.rustlang-es.org{}", location.get().as_str()) |
65 |
| - /> |
66 |
| - } |
67 |
| - } |
68 |
| - |
| 22 | + <HeadInformation/> |
69 | 23 | <Body class=format!(
|
70 | 24 | "bg-orange-200 dark:bg-[#131313]/90 bg-center bg-fixed {} dark:bri dark:bg-cover dark:bg-blend-darken dark:backdrop-blur-xl overflow-x-hidden dark:text-[#e2cea9]",
|
71 | 25 | bg_in_dark_mode,
|
|
0 commit comments