Allow Nanoc to process headings in Markdown or in frontmatter
What does this MR do and why?
For gitlab-org/technical-writing-group/gitlab-docs-hugo#56, we eventually need our Markdown files containing documentation to use the title
frontmatter instead of regular markdown level 1 headings.
This MR allows nanoc
to support both ways of declaring a level 1 heading (regular style or Hugo style).
How to set up and validate locally
- Set up a Docs local preview.
- Check out this branch.
- Run
make view
. Go to the local preview and confirm all the titles and pages look ok. In particular:- http://127.0.0.1:3000 - landing page hasn't regressed.
- http://127.0.0.1:3000/ee/development/ - developer docs still show badge.
- http://127.0.0.1:3000/ee/solutions/ - solutions docs still show badge.
- In the
gitlab
checkout, modifydoc/development/index.md
by removing the level 1 heading and addingtitle: Contribute to development as a test
to the frontmatter. - Run
make view
. Go to the local preview and confirm all the titles and pages look ok. In particular:- http://127.0.0.1:3000 - landing page hasn't regressed.
- http://127.0.0.1:3000/ee/development/ - developer docs still show badge. Note the modified title, but it otherwise looks the same as production.
- http://127.0.0.1:3000/ee/solutions/ - solutions docs still show badge.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.