summaryrefslogtreecommitdiff
path: root/docs/api.md
diff options
context:
space:
mode:
authorGravatar Caleb Jasik <calebjasik@jasik.xyz> 2021-06-16 17:39:47 -0500
committerGravatar GitHub <noreply@github.com> 2021-06-16 17:39:47 -0500
commit02d175cd95d669ce7ca7330cdb1395c51e4632ce (patch)
tree8eb83a7f8207cd6c10fc5be8c9c224ceeb473a2e /docs/api.md
parenteba4d81bf30c4b440f8dcf127afed1af3fc43c64 (diff)
downloadastro-02d175cd95d669ce7ca7330cdb1395c51e4632ce.tar.gz
astro-02d175cd95d669ce7ca7330cdb1395c51e4632ce.tar.zst
astro-02d175cd95d669ce7ca7330cdb1395c51e4632ce.zip
Update the shape of data provided by `Astro.fetchContent("./*.md")` (#479)
Diffstat (limited to 'docs/api.md')
-rw-r--r--docs/api.md20
1 files changed, 15 insertions, 5 deletions
diff --git a/docs/api.md b/docs/api.md
index 1d15dbf9e..b511d473d 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -27,12 +27,22 @@ const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of po
`.fetchContent()` only takes one parameter: a relative URL glob of which local files you’d like to import. Currently only `*.md` files are supported. It’s synchronous, and returns an array of items of type:
-```
+```js
{
- url: string; // the URL of this item (if it’s in pages/)
- content: string; // the HTML of this item
- // frontmatter data expanded here
-}[];
+ /** frontmatter from the post.. example frontmatter:
+ title: '',
+ tag: '',
+ date: '',
+ image: '',
+ author: '',
+ description: '',
+ **/
+ astro: {
+ headers: [], // TODO: document what this means
+ source: '' // raw source of the markdown file
+ },
+ url: '' // the rendered path
+ }[]
```
#### `request`