add google tag

This commit is contained in:
2025-04-18 21:57:05 -03:00
parent 920f3aec25
commit e8405923b8
6 changed files with 73 additions and 32 deletions

View File

@@ -2,22 +2,17 @@
import Layout from '~/layouts/Layout.astro'
import Container from '~/components/Container'
const { slug } = Astro.params
let res = await fetch(`https://betaeducacao.com.br/wp-json/wp/v2/posts?slug=${slug}&_embed`)
let [post] = await res.json()
// The getStaticPaths() is required for static Astro sites.
// If using SSR, you will not need this function.
export async function getStaticPaths() {
let data = await fetch('https://betaeducacao.com.br/wp-json/wp/v2/posts')
let posts = await data.json()
const data = await fetch('https://betaeducacao.com.br/wp-json/wp/v2/posts')
const posts = await data.json()
return posts.map((post) => ({
params: { slug: post.slug },
props: { post: post },
props: { post },
}))
}
const { post } = Astro.props
---
<Layout title={post.title.rendered}>