feat: option to use frontmatter ID as markdown filenames#22
feat: option to use frontmatter ID as markdown filenames#22rachfop merged 1 commit intorachfop:mainfrom smol-ninja:feat/file-naming-using-frontmatter-id
Conversation
|
Also tagging @rachfop since you are the owner of the repo. |
|
this feature would be tremendously helpful for our AI agentic workflows at Sablier |
|
thanks @smol-ninja, would you mind testing what happens if someone has not defined an explicit ID (e.g. you quickly remove some of the ids in your repo and see what the generated file name is), because if it is actually picking up the implicit ID as outlined here: https://docusaurus.io/docs/create-doc#document-id I would vote for removing the |
In that case, it picks up the file name as usual.
Are you suggesting to make it a default behaviour i.e. if id is mentioned, use that for filename always? |
Yes, based on the documentation from docusaurus, it sounds to me that there is always a DocumentID (https://docusaurus.io/docs/create-doc#document-id):
So if we can capture that ID somehow, then we have covered all the cases in one. |
Unfortunately, I could not find if Docusaurus offers an API to read that ID. So, I have added the following logic:
The new tests cover all cases. Let me know if it looks good: b28e843 |
|
@smol-ninja thank you for the PR. This looks great. |
|
Thanks for merging the PR. When will it be released? |
|
Can we please cut a new release? We really need this. |
|
We also need this feature for our documentation. We're currently using docusaurus-plugin-llms@0.2.2 to generate llms.txt files for our SDK documentation. |
…tter-id feat: option to use frontmatter ID as markdown filenames
Closes #20
@svrnm, given that I am using this plugin in Sablier docs, and because this feature is very important for us, I decided to add this over the weekend (with the help of Claude).
I have kept the default behaviour unchanged. However, if
useIdForFilenamesis set totrue, the filenames will use the frontmatter ID from the markdown files.I've tested it on the Sablier docs and its working as expected. So, I would really appreciate if you could give it a review and merge the PR after you have agreed to the changes.
Since it's a new feature, should the next release be
0.3.0?