From 9dc30c929922943c1e45decce13573e9ce5b5dcd Mon Sep 17 00:00:00 2001 From: David Ascanio Date: Sun, 8 Mar 2026 12:53:45 -0300 Subject: [PATCH] fix bugs url --- astro.config.mjs | 2 +- src/components/BaseHead.astro | 10 ++++++++-- src/components/ShareSticky.vue | 4 +--- src/layouts/MainLayout.astro | 17 ++++++++++++++--- src/pages/[locale]/news/[id].astro | 7 ++++++- src/pages/news/[id].astro | 6 +----- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 832fae6..62b7fa5 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -13,7 +13,7 @@ export default defineConfig({ vite: { plugins: [tailwindcss()], }, - + site: "https://mk8nrc8p-4321.brs.devtunnels.ms", //base: '/mockup/', integrations: [markdoc(), icon(), vue()], diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 21bad6b..141470d 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -2,8 +2,12 @@ import { ClientRouter } from "astro:transitions"; import { GoogleAnalytics } from 'astro-google-analytics'; -const { title = "Centro del Reino de Paz y Justicia", description = "" } = - Astro.props; +const { + title = "Centro del Reino de Paz y Justicia", + description = "", + image = null, + url = null, +} = Astro.props; --- @@ -15,5 +19,7 @@ const { title = "Centro del Reino de Paz y Justicia", description = "" } = {title} + {url && } + {image && } \ No newline at end of file diff --git a/src/components/ShareSticky.vue b/src/components/ShareSticky.vue index 04c19a6..901be89 100644 --- a/src/components/ShareSticky.vue +++ b/src/components/ShareSticky.vue @@ -106,9 +106,7 @@ const copyLink = async () => { console.error("No se pudo copiar") } } -const BASE_URL = typeof window !== "undefined" - ? `${window.location.protocol}//${window.location.host}` - : "" +const BASE_URL = window.location.host const fullUrl = computed(() => { if (props.url.startsWith("http")) { diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index 43431ac..be44627 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -8,7 +8,13 @@ import "@fontsource/poppins/500.css"; import "@fontsource/poppins/700.css"; import "@fontsource-variable/kameron"; import ShareSticky from "../components/ShareSticky.vue"; -const { title } = Astro.props; +const { + title, + description, + image, + url +} = Astro.props; + --- - + {Astro.url.pathname.includes('/news/') && ( - + )}