#Adding styles to frontmatter title prop

23 messages · Page 1 of 1 (latest)

twin cradle
#

I want the outputted header to have "Content-Type" look like inline code

title: Content-Type Parser
description: A guide in my new Starlight docs site.

buoyant spindleBOT
#
Quiet in here?

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.

muted tartan
twin cradle
#

I didn't find it in the astro docs either. any idea? I might just punch out of starlight

muted tartan
gilded rock
#

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?

twin cradle
#

Didn't work 😦

#

Might just pop out of starlight and build up from the bottom...

gilded rock
#

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

twin cradle
#

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

gilded rock
#

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?

twin cradle
#

Sorry for the late reply! I would say yes

#

You said "we could support" it, but how did you get it to work now?