diff options
author | 2021-11-19 14:53:38 -0500 | |
---|---|---|
committer | 2021-11-19 14:53:38 -0500 | |
commit | 16926755758790e0396a2301578de72fafefa1ea (patch) | |
tree | 8d999f4145e6f1c7be75b3c26aa6f70726fcccf3 /docs/src/pages/reference/api-reference.md | |
parent | 447d2efaffafacc907e651931344b08d53388489 (diff) | |
download | astro-16926755758790e0396a2301578de72fafefa1ea.tar.gz astro-16926755758790e0396a2301578de72fafefa1ea.tar.zst astro-16926755758790e0396a2301578de72fafefa1ea.zip |
Doc improvements (#1929)
* Update astro & markdown code blocks for consistency
* Add 'JSX in Frontmatter' note to Migration Guide
Diffstat (limited to 'docs/src/pages/reference/api-reference.md')
-rw-r--r-- | docs/src/pages/reference/api-reference.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/src/pages/reference/api-reference.md b/docs/src/pages/reference/api-reference.md index d3b846807..274f0a032 100644 --- a/docs/src/pages/reference/api-reference.md +++ b/docs/src/pages/reference/api-reference.md @@ -103,7 +103,7 @@ If a page uses dynamic params in the filename, that component will need to expor This function is required because Astro is a static site builder. That means that your entire site is built ahead of time. If Astro doesn't know to generate a page at build time, your users won't see it when they visit your site. -```jsx +```astro --- export async function getStaticPaths() { return [ @@ -129,7 +129,7 @@ The `params` key of every returned object tells Astro what routes to build. The For example, suppose that you have a page at `src/pages/posts/[id].astro`. If you export `getStaticPaths` from this page and return the following for paths: -```js +```astro --- export async function getStaticPaths() { return [ @@ -150,7 +150,7 @@ To pass additional data to each generated page, you can also set a `props` value For example, suppose that you generate pages based off of data fetched from a remote API. You can pass the full data object to the page component inside of `getStaticPaths`: -```js +```astro --- export async function getStaticPaths() { const data = await fetch('...').then(response => response.json()); |