Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the shape of data provided by Astro.fetchContent("./*.md") #479

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

jasikpark
Copy link
Contributor

@jasikpark jasikpark commented Jun 16, 2021

Changes

  • What does this change?
  • Be short and concise. Bullet points can help!
  • Before/after screenshots can be helpful as well.
  • Docs change

Testing

Docs only change.

Docs

  • Documents the shape of data returned by Astro.fetchContent when used with markdown, closes Add documentation of content variable #367
  • { astro.headers[]f } still needs explanation since I haven't figured out what it will return, since it's been empty when I've printed it out.

@jasikpark jasikpark requested a review from a team as a code owner June 16, 2021 22:00
@changeset-bot
Copy link

changeset-bot bot commented Jun 16, 2021

⚠️ No Changeset found

Latest commit: 0de408e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jun 16, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/astro-www/ANGqtpCs4Gc7axQqXHKjUsFMqn6e
✅ Preview: https://astro-www-git-fork-jasikpark-update-api-docs-pikapkg.vercel.app

@natemoo-re
Copy link
Member

Looks good to me!

These aren't changes to this PR, but I think this surfaces that url should be namespaced under astro... We might also want to expose html in addition to source? Can tackle that in a follow-up PR.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@natemoo-re natemoo-re merged commit 02d175c into withastro:main Jun 16, 2021
@jasikpark
Copy link
Contributor Author

Looks good to me!

These aren't changes to this PR, but I think this surfaces that url should be namespaced under astro... We might also want to expose html in addition to source? Can tackle that in a follow-up PR.

It seems like that's a bit like how it already works in https://github.com/jasikpark/astro/blob/0de408e/packages/markdown-support/src/index.ts#L31 where renderMarkdown returns

return {
    astro: { headers, source: content },
    content: result.toString(),
  };

which is called by renderMarkdownWithFrontmatter and returned as

const value = await renderMarkdown(content, { ...opts, mode: 'md' });
  return { ...value, frontmatter };

which gives us the values I just documented. I'll see if I can make a PR for updating the shape of the data provided.

@jasikpark jasikpark deleted the update-api-docs branch June 16, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation of content variable
2 participants