#Adding styles to frontmatter title prop
23 messages · Page 1 of 1 (latest)
It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.
This is not currently supported in Starlight
I didn't find it in the astro docs either. any idea? I might just punch out of starlight
Its not currently possible inside of Starlight, but if you want to do this your own project you can parse the frontmatter property as markdown, something like in this example in the docs: https://docs.astro.build/en/guides/markdown-content/#fetching-remote-markdown
We might be able to support this in Starlight. Most likely with plain HTML support e.g.
title: "<code>Content-Type</code> Parser"
description: A guide in my new docs site
It is worth bearing in mind that title is used in several places. Most notably in <title> tags for that page (shown in browser tabs and search results), but also potentially in the sidebar when using autogenerated navigation. I’m assuming you would not want to see this formatting show up there?
Didn't work 😦
Might just pop out of starlight and build up from the bottom...
Ah, I should have been clearer. Not supported right now, but I was saying we could support it. Taking a look now.
Any thoughts on my second point about what happens in other places your title gets used?
For instance, this is what you want, I think:
But would that also be desirable here in the sidebar?
@twin cradle
^ so this occurred in sidebar too
What I wanted was for the title to be “Content-Type Parser”
So that’s it’s clear the page is talking about the parameter Content-Type and not just any content-type lol
Im trying to port the Fastify docs for reference
Ah yeah, I didn’t set up the background colour on code but if you look at my screenshot you should see that Content-Type is using a monospace font — I was mostly just wanting to demo the <code> being rendered.
My question was if that should also be reflected in the sidebar? I’m guessing yes?