Skip to content

Conversation

@zastrowm
Copy link
Member

Description

I'm incrementally working towards getting our docs working with astro.build - to do so markdown files need a title front-matter.

Currently, mkdocs does this to derive the title:

The "title" to use for the document.

MkDocs will attempt to determine the title of a document in the following ways, in order:

  1. A title defined in the nav configuration setting for a document.
  2. A title defined in the title meta-data key of a document.
  3. A level 1 Markdown header on the first line of the document body.
    (Setext-style headers are supported only since MkDocs 1.5.)
  4. The filename of a document.

Upon finding a title for a page, MkDoc does not continue checking any additional sources in the above list.

However, astro.build desires the title to be in the front-matter; for compatibility with both, add the title from the nav and add it as a frontmatter meta property. Also added a test to enforce this for now

Type of Change

  • New content addition

Motivation and Context

Incrementally let's docs work for both astro.build and mkdocs

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using mkdocs serve
  • Links in the documentation are valid and working
  • Images/diagrams are properly sized and formatted
  • All new and existing tests pass

Additional Notes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

As part of the site revamp CMS (astro.build) we need titles on each page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant