Compare commits
5 Commits
9468b0549d
...
25b4875e47
| Author | SHA1 | Date |
|---|---|---|
|
|
25b4875e47 | |
|
|
ffd7ea452f | |
|
|
da847533fe | |
|
|
9dc30c9299 | |
|
|
2c82a52f59 |
|
|
@ -13,7 +13,7 @@ export default defineConfig({
|
|||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
},
|
||||
|
||||
site: "https://centrodelreinodepazyjusticia.com/",
|
||||
//base: '/mockup/',
|
||||
|
||||
integrations: [markdoc(), icon(), vue()],
|
||||
|
|
|
|||
|
|
@ -2,8 +2,14 @@
|
|||
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;
|
||||
|
||||
const imageUrl = image ? new URL(image, Astro.site).toString() : null;
|
||||
---
|
||||
|
||||
<head>
|
||||
|
|
@ -13,7 +19,29 @@ const { title = "Centro del Reino de Paz y Justicia", description = "" } =
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<GoogleAnalytics id="G-26KM3HWW9J" />
|
||||
|
||||
<title>{title}</title>
|
||||
<meta property="og:site_name" content={title} />
|
||||
<meta name="description" content={description} />
|
||||
|
||||
<!-- Open Graph -->
|
||||
|
||||
{url && <meta property="og:url" content={url} />}
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
|
||||
{imageUrl && <meta property="og:image" content={imageUrl} />}
|
||||
<meta property="og:image:width" content="1200">
|
||||
<meta property="og:image:height" content="630">
|
||||
|
||||
<!-- Twitter -->
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
{imageUrl && <meta name="twitter:image" content={imageUrl} />}
|
||||
{url && <meta name="twitter:url" content={url} />}
|
||||
|
||||
</head>
|
||||
<ClientRouter />
|
||||
|
|
@ -23,11 +23,6 @@
|
|||
<Icon icon="ph:facebook-logo-thin" class="text-2xl" />
|
||||
</a>
|
||||
</li>
|
||||
<li class="border-b pb-3">
|
||||
<a :href="instagramUrl" target="_blank">
|
||||
<Icon icon="ph:instagram-logo-thin" class="text-2xl" />
|
||||
</a>
|
||||
</li>
|
||||
<li class="border-b pb-3">
|
||||
<a :href="whatsappUrl" target="_blank">
|
||||
<Icon icon="ph:whatsapp-logo-thin" class="text-2xl" />
|
||||
|
|
@ -60,9 +55,6 @@
|
|||
<a :href="facebookUrl" target="_blank" class="text-gray-600 hover:text-blue-600 transition border-b pb-3">
|
||||
<Icon icon="ph:facebook-logo-thin" class="text-2xl" />
|
||||
</a>
|
||||
<a :href="instagramUrl" target="_blank" class="text-gray-600 hover:text-pink-600 transition border-b pb-3">
|
||||
<Icon icon="ph:instagram-logo-thin" class="text-2xl" />
|
||||
</a>
|
||||
<a :href="whatsappUrl" target="_blank" class="text-gray-600 hover:text-green-600 transition border-b pb-3">
|
||||
<Icon icon="ph:whatsapp-logo-thin" class="text-2xl" />
|
||||
</a>
|
||||
|
|
@ -106,9 +98,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")) {
|
||||
|
|
@ -123,5 +113,4 @@ const twitterUrl = computed(() => `https://twitter.com/intent/tweet?url=${encode
|
|||
const facebookUrl = computed(() => `https://www.facebook.com/sharer/sharer.php?u=${encodedUrl.value}`)
|
||||
const whatsappUrl = computed(() => `https://api.whatsapp.com/send?text=${encodedUrl.value}`)
|
||||
const linkedinUrl = computed(() => `https://www.linkedin.com/sharing/share-offsite/?url=${encodedUrl.value}`)
|
||||
const instagramUrl = computed(() => `https://www.instagram.com/centrodelreinodepazyjusticia`)
|
||||
</script>
|
||||
|
|
@ -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;
|
||||
|
||||
---
|
||||
<style is:global>
|
||||
img {
|
||||
|
|
@ -20,7 +26,12 @@ const { title } = Astro.props;
|
|||
</style>
|
||||
|
||||
<html lang="en" class="scroll-smooth">
|
||||
<BaseHead title={title} />
|
||||
<BaseHead
|
||||
title={title}
|
||||
description={description}
|
||||
image={image}
|
||||
url={url}
|
||||
/>
|
||||
<script>
|
||||
document.addEventListener('contextmenu', event => {
|
||||
if (event.target.tagName === 'IMG') {
|
||||
|
|
@ -30,7 +41,7 @@ const { title } = Astro.props;
|
|||
</script>
|
||||
<body class="font-primary">
|
||||
{Astro.url.pathname.includes('/news/') && (
|
||||
<ShareSticky client:load url={Astro.url.href} />
|
||||
<ShareSticky client:only url={Astro.url.href} />
|
||||
)}
|
||||
<slot />
|
||||
<Footer />
|
||||
|
|
|
|||
|
|
@ -38,7 +38,12 @@ const baseSlug = routeTranslations.news[locale] || routeTranslations.news.en;
|
|||
---
|
||||
</style>
|
||||
|
||||
<MainLayout>
|
||||
<MainLayout
|
||||
title={post.data.title}
|
||||
description={`${post.data.title} - ${post.data.city ?? ""} ${post.data.country ?? ""}`}
|
||||
image={post.data.thumbnail}
|
||||
url={new URL(`/${locale}/${"news"}/${post.id}`, Astro.site)}
|
||||
>
|
||||
<div class="container mx-auto md:py-16 py-8">
|
||||
<Header />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,15 +19,11 @@ export async function getStaticPaths() {
|
|||
const { post } = Astro.props;
|
||||
const { Content } = await render(post);
|
||||
|
||||
console.log("astro site", Astro.site);
|
||||
const baseUrl = Astro.site ?? "https://mk8nrc8p-4321.brs.devtunnels.ms";
|
||||
|
||||
const pageUrl = new URL(`/es/news/${post.id}`, baseUrl).toString();
|
||||
|
||||
const imageUrl = post.data.thumbnail
|
||||
? new URL(post.data.thumbnail.src, baseUrl).toString()
|
||||
: null;
|
||||
|
||||
const description = `${post.data.title} - ${post.data.city ?? ""} ${post.data.country ?? ""}`;
|
||||
---
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue