Skip to content

Commit

Permalink
refactor: Add front-matter title to auto-generated reference pages
Browse files Browse the repository at this point in the history
Contrary to the mkdocs-section-index plugin, the section index feature of Material for MkDocs will show `index` as title of index pages. We fix that with a front-matter metadata title.

Issue-20: #20
  • Loading branch information
pawamoy committed Mar 28, 2024
1 parent 4dbb47c commit 8f33202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion project/scripts/gen_ref_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

with mkdocs_gen_files.open(full_doc_path, "w") as fd:
ident = ".".join(parts)
fd.write(f"::: {ident}")
fd.write(f"---\ntitle: {ident}\n---\n\n::: {ident}")

mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path.relative_to(root))

Expand Down

0 comments on commit 8f33202

Please sign in to comment.