add google tag
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user