-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: add support for other markdown file extensions #5164
feat: add support for other markdown file extensions #5164
Conversation
adds `.markdown` file extension support for markdown files
🦋 Changeset detectedLatest commit: 85b625d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks like the mdx integration doesn't need a changeset, tell me I'll revert that |
One more small change needed: packages/astro-rss/test/rss.test.js#L201 - chai.expect(err.message).to.contain('you can only glob ".md" files within /pages');
+ chai.expect(err.message).to.contain('you can only glob ".md" or ".markdown" files within /pages'); |
@MoustaphaDev - This looks great from the perspective of Docs-facing stuff in files for this PR! As for what needs to go directly in Docs, I believe it should just be the I even checked the Layouts page which has a Markdown Layouts section, and we only say "Markdown" (we don't mention the file extension), so I think just targeting Are you willing to make a Docs PR, or do you want someone from Team Docs to take this on? |
Thanks @sarah11918 for pointing me to the right direction, I will open a docs PR to include this update. |
There's a few more extensions that are sometimes used for Markdown. GitHub for instance supports the following: |
Right, better support all the options, I'll make some changes in a bit |
Code looks very clean! Think this should be marked as |
.markdown
file extension support@@ -58,7 +58,7 @@ function mapGlobResult(items: GlobResult): Promise<RSSFeedItem[]> { | |||
const { url, frontmatter } = await getInfo(); | |||
if (url === undefined || url === null) { | |||
throw new Error( | |||
`[RSS] When passing an import.meta.glob result directly, you can only glob ".md" files within /pages! Consider mapping the result to an array of RSSFeedItems. See the RSS docs for usage examples: https://docs.astro.build/en/guides/rss/#2-list-of-rss-feed-objects` | |||
`[RSS] When passing an import.meta.glob result directly, you can only glob ".md" (or alternative extensions for markdown files like ".markdown") files within /pages! Consider mapping the result to an array of RSSFeedItems. See the RSS docs for usage examples: https://docs.astro.build/en/guides/rss/#2-list-of-rss-feed-objects` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would cause a patch for the rss package, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's file.
@MoustaphaDev can you remove the |
Will do in a moment, I'll just add some test cases for the new extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from a docs perspective!
Changes
Closes #5148. Adds support for the following markdown file extensions:
.markdown
.mdown
.mkdn
.mkd
.mdwn
Testing
markdown.test.js
test suite was updated to include test coverage for markdown pages with the new extensions.rss.test.js
was updated to match the updated error message.Docs
withastro/docs#1893