diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 016ad67..debc779 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -1,7 +1,7 @@ --- import { ClientRouter } from "astro:transitions"; -import { GoogleAnalytics } from 'astro-google-analytics'; +import { GoogleAnalytics } from "astro-google-analytics"; const { title = "Centro del Reino de Paz y Justicia", description = "", @@ -11,6 +11,7 @@ const { } = Astro.props; const imageUrl = image ? new URL(image, Astro.site).toString() : null; +const canonicalURL = new URL(url || Astro.url.pathname, Astro.site); --- @@ -19,24 +20,39 @@ const imageUrl = image ? new URL(image, Astro.site).toString() : null; - + {title} - + {url && } + {imageUrl && } - - + + - {date && } + { + date && ( + + ) + } @@ -45,6 +61,5 @@ const imageUrl = image ? new URL(image, Astro.site).toString() : null; {imageUrl && } {url && } - - \ No newline at end of file + diff --git a/src/pages/[locale]/[news_slug]/[id].astro b/src/pages/[locale]/[news_slug]/[id].astro index 383dd78..5b190a1 100644 --- a/src/pages/[locale]/[news_slug]/[id].astro +++ b/src/pages/[locale]/[news_slug]/[id].astro @@ -67,7 +67,7 @@ const dateISO = `${y}-${m}-${d}`; title={post.data.title} description={excerpt} image={post.data.thumbnail} - url={canonicalUrl} + url={canonicalUrl.toString()} date={post.data.date} >