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

Front matter can't be changed? #45

Open
atomicbird opened this issue Apr 14, 2021 · 2 comments
Open

Front matter can't be changed? #45

atomicbird opened this issue Apr 14, 2021 · 2 comments

Comments

@atomicbird
Copy link

Is it supposed to be possible to change the front matter? It seems no matter what I do, I can't get rid of

---
title: index
---

I looked at utils/file.js and I've tried to insert my own front matter but the default always appears. I thought I'd need something with similar formatting to the above, but adding that just means I get both my own front matter and the default.

@hannut91
Copy link
Owner

Thank you for your attention.
I just started working at work.
In the evening, I will check the issue and answer it.
Thank you

@atomicbird
Copy link
Author

Some more detail. I see in utils/file.js that the extractFrontMatter function looks for text at the beginning of a file that's delimited by --- at the beginning and the end. If that's not found for some reason, it throws an error and the front matter for a file named index.md is

---
title: index
---

But when I insert my own front matter I always get the default anyway. If my file starts with

---
title: stuff
---

Then the exported file starts with:

---
title: index
---
---
title: stuff
---

It seems like utils/file.js is checking for front matter but then always inserting default front matter anyway.

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

No branches or pull requests

2 participants