You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was trying to find a way since docuaurus ver 1 to find a way I could publish md files without making any change to conform them to frontmatter, I wanted to get rid of putting "id" in hundreds of files. In ver 2, that problem was solved. But i find that since my filenaming is in format word1_word2_word3.md (eg:"system_design_documents.md", i do need to add frontmatter to take care of 2 things:
clean sidelabels ("System Design Documents" looks better than "system_design_documents")
clean title ( I already had all the documents starting with legible H1's.
For handling these 2 scenarios, i find myself eventually editing all the files or writing a small hack to add these elements to the md files.
Can we have a feature wherein we can have the starting H1 of the document be treated as doc title ?
Adding space in filename breaks the navigation urlencodes the url which somehow don't look clean (although its a subjective opinion)
If there is a md file with both a frontmatter title and a # title, which wins?
The "# title" never makes it. Even if there is no frontmatter title, the "# title" is never set as title, because docusaurus doesnt process any markup content for meta purposes.
Adding space in filename breaks the navigation urlencodes the url which somehow don't look clean (although its a subjective opinion)
You mean you don't like the %20 here?
I think we should just slugify this filename (ie you would end up with /my-test).
This would also fix the error when using filenames with special chars:
The "# title" never makes it. Even if there is no frontmatter title, the "# title" is never set as title, because docusaurus doesnt process any markup content for meta purposes.
The issue is that we end up with the title that is inferred from the filename instead of the # Hello title in the doc.
My question was more related to the behavior we actually want if we fix your issue, considering the edge cases where there is potentially a title frontmatter and multiple h1 headings in the markdown document.
My idea is:
frontmatter always win
if no frontmatter and an h1 heading is at the very top, we use it as title instead of the filename
if no frontmatter and an h1 heading is found in the middle of a doc, we ignore it
Activity
slorber commentedon Mar 15, 2021
Frontmatter is optional: what about naming the doc
System Design Documents.md?If there is a md file with both a frontmatter title and a
# title, which wins?ashutoshkumars commentedon Mar 16, 2021
Adding space in filename breaks the navigation urlencodes the url which somehow don't look clean (although its a subjective opinion)
The "# title" never makes it. Even if there is no frontmatter title, the "# title" is never set as title, because docusaurus doesnt process any markup content for meta purposes.
slorber commentedon Mar 16, 2021
You mean you don't like the
%20here?I think we should just slugify this filename (ie you would end up with
/my-test).This would also fix the error when using filenames with special chars:
The issue is that we end up with the title that is inferred from the filename instead of the
# Hellotitle in the doc.My question was more related to the behavior we actually want if we fix your issue, considering the edge cases where there is potentially a title frontmatter and multiple h1 headings in the markdown document.
My idea is:
[-]Zero-edit frontmatter MD file for publishing[/-][+]Support docs without frontmatter[/+]