-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add optional frontmatter snippet to new notes. #217
Comments
Hey! I love this suggestion 😄 Would it be sufficient to simply say that you want a front-matter title as well when generating new daily pages? Or would you want to be able to specify the entire front-matter block? I just ask because I could probably add a setting to allow generating a front-matter section for new page, that simply auto-generated the title based on the date. But if you'd want to also add other content to the template, than we'd probably need another, more generic solution. |
I would personally be more than happy with the first suggestion of generating a front-matter section with a title based on the date via a toggleable setting. This would make it practically frictionless to add new posts for my particular use case. It would also be good to have a more generic solution, but this may be a bit more complex. For instance, Docusaurus's example post has 9 separate fields: ---
title: Welcome Docusaurus v2
author: Joel Marcey
author_title: Co-creator of Docusaurus 1
author_url: https://github.com/JoelMarcey
author_image_url: https://graph.facebook.com/611217057/picture/?height=200&width=200
tags: [hello, docusaurus-v2]
description: This is my first post on Docusaurus 2.
image: https://i.imgur.com/mErPwqL.png
hide_table_of_contents: false
--- Granted, it would be convenient to have certain static fields like The generic solution would probably be more valuable to users that are making posts for a website with multiple writers or if there were repeating metadata when making new posts. But again, it would be great to have the non-generic solution as well. |
I wonder if it would make sense to allow adding a In order to parameterize it, the template could support mustache placeholders (e.g. Example
|
That sounds great, pretty much exactly what I would would want as a user, especially if the feature gains the ability to also add more mustache placeholders over time. I feel like the solution is also flexible enough to cover a large amount of use cases, minimizing a lot of redundant busywork with the click of a button. |
Is your feature request related to a problem? Please describe.
Currently, when clicking on the calendar icon in VSCode, a new markdown file is autogenerated and added to a configurable directory.
The filename is the current date, and the same date is used to populate the first header in the generated file:
2021-03-25.md
# March 25, 2021
I really like how one click gets you to immediately writing a new note for the specific date.
Describe the solution you'd like
I would like it if it was possible to change the generated content in the markdown file to include some basic frontmatter metadata so that it would look something like this:
2021-03-25.md
Describe alternatives you've considered
I can just write in the required frontmatter text every time, but it kind of goes against the spirit of clicking on the button and immediately getting to writing.
Additional context
I've been using this app to integrate with the blogging side of docusaurus.
It'd be great to generate entirely new blog posts just from the click of a single button.
The text was updated successfully, but these errors were encountered: