-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
feature: handle properties as frontmatter #26
Comments
Hey Parker, thanks for the suggestion I see a lot of CMS-based projects are using this package so I understand how handy this feature will be therefore I don't mind adding it. It has to be a separate method rather than adding it to the existing methods. I do have a few things in mind related to this so, let me know if you are interested. We can discuss the approach and possible use cases. |
Hey! Completely understandable. Implementing it as a different method would be quite useful so the feature could be entirely opt-in if the developer wants to use it. I think it would be cool to have as a part of the package and I'd be glad to help. Would love to hear some of your ideas on this topic too :) |
Awesome. Let's work on a basic version.
if you have any other approaches or questions in mind then feel free to share. |
Hey guys, I've worked on the same feature for the ruby package. Basically, I've taken the same approach as you mention @parkuman. The Front matter is optional. Anyway, I'm leaving the comment here so perhaps what has been done in notion_to_md can help you. The front matter is parsed here. Cheers! |
@emoriarty Nice! I really like the conversion to snake case even if its not like that already. Thank you for sharing that. @souvikinator the two staged approach could definitely work well. Seems like frontmatter is commonly used as JSON, TOML (but more often than not), YAML: https://gohugo.io/content-management/front-matter/ . We could allow the user to choose the outputted language for frontmatter, but for now just YAML would be perfect. So some other questions I thought of:
I guess the main question is do we want to include all information from each and convert it to YAML? Or only pick and choose the more useful ones like @emoriarty and I have been doing. If there's no preference then I could get started on one that just includes all the information and go from there :) The Type definitions from the notion package shows them all, i think this is where they are: https://github.com/makenotion/notion-sdk-js/blob/main/src/api-endpoints.ts |
True, we can go with YAML for now and later allow users to pass a parameter mentioning the language.
The requirement varies from person to person so probably we have to make it in a way users can remove unnecessary properties. Possible flow:
or
options={
language?: "",
remove?: [ fields_to_remove... ]
} for fields like
Great work! however, I'm not sure if the color thing is supported in Hugo and other popular static site generators, so for the time being we can keep the
let's just extract the name for now. Would love to hear your thoughts on this. |
Hello there, I'm closing this issue as it is out of the scope for the package. |
Hey, @souvikinator I don't really agree with you about this feature not being in the scope of the package. The point here is to facilitate using notion as a CMS using standard formats and clearly markdown with frontmatter is part of it. I'll go for my own custom implementation and will report it here in case it helps others, maybe we could discuss about making this core later. |
How come the page properties are not a part of a page? 🤷 Your decision, of course. |
Hey @kuzzmi |
Hey guys, I have created first draft for version 4 and wanted some input before starting off with implementation and also targeting this very issue. Please feel free to give your inputs here: #112 |
Hey everyone!
I thought it would be an interesting feature to allow
notion-to-md
to take properties of a page and convert them to YAML-style markdown frontmatter. For example:A notion page with the following properties:
would get converted to the following markdown:
I've started working on a similar parser for my personal site using Notion as my blog CMS (example WIP code here), but I thought it could be useful to have it baked into
notion-to-md
.Feel free to discuss! 🍻
The text was updated successfully, but these errors were encountered: