From 7e0d6d5a50933455e4707b8d246932a91d79e350 Mon Sep 17 00:00:00 2001 From: h4ckx0r Date: Mon, 10 Mar 2025 21:12:02 +0100 Subject: [PATCH] =?UTF-8?q?Optimizaci=C3=B3n=20del=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/PostStyle.astro | 261 ------------------- src/pages/{posts.astro => posts/index.astro} | 14 +- 2 files changed, 2 insertions(+), 273 deletions(-) delete mode 100644 src/layouts/PostStyle.astro rename src/pages/{posts.astro => posts/index.astro} (61%) diff --git a/src/layouts/PostStyle.astro b/src/layouts/PostStyle.astro deleted file mode 100644 index 1248396..0000000 --- a/src/layouts/PostStyle.astro +++ /dev/null @@ -1,261 +0,0 @@ ---- -import RelatedPosts from "../components/PostsRelacionados.astro"; // Componente para posts relacionados -import Navbar from "../components/Navbar.astro"; -import Footer from "../components/Footer.astro"; - -const { frontmatter } = Astro.props; -const headings = Astro.props.headings; -const description = frontmatter.descripcion; - -// URLs para compartir en redes sociales -const shareUrl = new URL(Astro.url.pathname, Astro.site).toString(); -const facebookShareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`; -const twitterShareUrl = `https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}&text=${encodeURIComponent(frontmatter.titulo)}`; -const linkedinShareUrl = `https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(shareUrl)}&title=${encodeURIComponent(frontmatter.titulo)}`; - -const blogJsonLd = { - "@context": "https://schema.org", - "@type": "BlogPosting", - "headline": frontmatter.titulo, - "image": frontmatter.imagen && new URL(frontmatter.imagen, Astro.site), - "datePublished": frontmatter.fecha, - "dateModified": frontmatter.fecha, - "author": { - "@type": "Person", - "name": frontmatter.autor - }, - "publisher": { - "@type": "Organization", - "name": "Ecobjetivos", - "logo": { - "@type": "ImageObject", - "url": new URL('/logo.png', Astro.site) - } - }, - "description": description -}; ---- - - - - - - {frontmatter.titulo} - Ecobjetivos - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/pages/posts.astro b/src/pages/posts/index.astro similarity index 61% rename from src/pages/posts.astro rename to src/pages/posts/index.astro index 6191f9e..40635d1 100644 --- a/src/pages/posts.astro +++ b/src/pages/posts/index.astro @@ -1,6 +1,6 @@ --- -import Navbar from "../components/Navbar.astro"; -import ListadoPosts from "../layouts/ListadoPosts.astro"; +import Navbar from "../../components/Navbar.astro"; +import ListadoPosts from "../../layouts/ListadoPosts.astro"; --- @@ -9,12 +9,6 @@ import ListadoPosts from "../layouts/ListadoPosts.astro"; - -