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

Migrate utility adds YAML front matter to non-markdown files #6145

Closed
2 of 7 tasks
cmpadden opened this issue Dec 21, 2021 · 2 comments · Fixed by #6146
Closed
2 of 7 tasks

Migrate utility adds YAML front matter to non-markdown files #6145

cmpadden opened this issue Dec 21, 2021 · 2 comments · Fixed by #6146
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@cmpadden
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

When running the migration utility:

npx @docusaurus/migrate migrate  ./v1-website ./v2-website

An empty front-matter section is added to non-markdown files in the docs/ directory. This includes and is not limited to files with the extensions: .json, .svg, .drawio, .sh, .js, .json, and .yaml.

It was also added to the .gitignore file in the docs/ directory.

This results in an empty front-matter at the top of these files:

---
---

Steps to reproduce

  1. Create a .gitignore file in your docs/ directory.
  2. Run npx @docusaurus/migrate migrate ./v1-website ./v2-website

Expected behavior

Front-matter should only be added to documentation files like those with the .md and .mdx extension (and other supported file formats).

Actual behavior

Front-matter was added to all files, eg. .gitignore became:

---
---
<my_ignored_files>

Your environment

The latest version of @docusaurus/migrate was used as of this writing: 2.0.0-beta.13

Reproducible demo

No response

Self-service

  • I'd be willing to fix this bug myself.
@cmpadden cmpadden added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Dec 21, 2021
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Dec 21, 2021
@Josh-Cena
Copy link
Collaborator

Thanks for reporting! Will be fixed by #6146. After that, you can test again with npx @docusaurus/migrate@canary

@cmpadden
Copy link
Contributor Author

Thanks for reporting! Will be fixed by #6146. After that, you can test again with npx @docusaurus/migrate@canary

Great - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants