feature: load default_frontmatter.md for new page#505
Conversation
Rendering of markdown files via pandoc often requires certain settings in the front matter. Create a `default_frontmatter.md` in the directory that will mount to otterwiki's custom folder. Upon creating a new page the frontmatter will be inserted.
redimp
left a comment
There was a problem hiding this comment.
Hey @benndorfj, thanks for this PR. Please check the changes that I proposed.
I'm not concerned about security checks or sanitizing the default_frontmatter.md since this is admin deployed and controlled.
|
Thank you @redimp! Your approach is cleaner, only adding linebreaks as necessary and then adding I hope having a default frontmatter is relevant to other otterwiki users. How do we preceed - do you want me to edit my version and do another pull request? |
|
Please update your version and push it to |
improved try / except logic, now only adding linebreaks if necessary
improved try / except logic, now only adding linebreaks if necessary
|
sorry for the clutter, still learning, first file went into the wrong directory |
|
No worries, that's what reviews are for. One last thing before merging: please clean up the commit history. The three commits are variants of the same change, so they should be squashed into a single commit with a message like git rebase -i HEAD~3 # keep the first commit as "pick", change the others to "squash"
git push --force origin benndorfj-patch-1If you'd rather not wrestle with interactive rebase, just say so and I'll take it from here: I'll squash the commits myself and merge, with you kept as the author of the change. |
|
If you are wiling to do the merge / commit, please do so. I very much appreciate it! |
Rendering of markdown files via pandoc often requires certain settings in the front matter.
Create a
default_frontmatter.mdin the directory that will mount to otterwiki's custom folder. Upon creating a new page the frontmatter will be inserted.Caution: There is no security check or saniztization in place.