Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

Per-`Page` override of page title

Open ArnoStrouwen opened this issue 1 year ago • 3 comments

Currently, if you go to the documentation of a Julia package e.g. https://juliadocs.github.io/Documenter.jl/ the <title> element of the page is <title>Home · Documenter.jl</title>, where the "Home" comes from the first item on the dropdown menu. Is there a way to separate those two? The

element seems to be important for google search results, thus it would be nice to have finer control over it.

ArnoStrouwen avatar Aug 05 '22 10:08 ArnoStrouwen

What do you mean by separating them? And regarding control: do you mean e.g. the ability to override the <title> element on a per-page page?

mortenpi avatar Aug 06 '22 04:08 mortenpi

By separating them, I mean being able to specify the <title> element of each page as something different than the text that appears in the dropdown menu.

ArnoStrouwen avatar Aug 06 '22 05:08 ArnoStrouwen

I think this is something we could have. It's pretty common in Markdown document generators that you can set the page title in some YAML front matter etc. Probably a new Title option in the at-meta block.

I have to leave the implementation up for grabs, but as a breadcrumb, the <title> string in the HTML writer gets constructed here:

https://github.com/JuliaDocs/Documenter.jl/blob/ebe2f97acc9e37c87f7f44772ebf64492c5b0b21/src/Writers/HTMLWriter.jl#L939

mortenpi avatar Aug 06 '22 23:08 mortenpi