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

Allow MDX imports to be above h1 heading #4635

Closed
duanwilliam opened this issue Apr 16, 2021 · 1 comment · Fixed by #4646
Closed

Allow MDX imports to be above h1 heading #4635

duanwilliam opened this issue Apr 16, 2021 · 1 comment · Fixed by #4646
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@duanwilliam
Copy link
Contributor

🚀 Feature

With the current frontmatter-less parsing, the h1 heading must be at the top of the file, excluding frontmatter, for it to be used as the title rather than the filename. It'd be useful if import nodes could be placed above the heading without compromising the h1 heading's function as the title.

Have you read the Contributing Guidelines on issues?

yes

Motivation

It's just a quality of life feature that in my opinion would be useful

Pitch

ES6 JS imports are always placed at the top of the file, and this should be permitted for the markdown files as well without unintended side effects. Keeping the imports at the top of the file, separate from all the other content (including the h1 heading title) also helps decouple the actual "page content" of the file and the "metadata" associated with it (frontmatter, imports, etc)

@duanwilliam duanwilliam added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Apr 16, 2021
@slorber
Copy link
Collaborator

slorber commented Apr 19, 2021

agree, using MDX imports at the top of the file should be supported

@slorber slorber changed the title Allow imports to be above h1 heading Allow MDX imports to be above h1 heading Apr 19, 2021
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants