jonasmerlin / astro-seo

Makes it easy to add information that is relevant for SEO to your Astro app.
MIT License
908 stars 50 forks source link

How to use in pure .md #94

Open SamuelLHuber opened 4 months ago

SamuelLHuber commented 4 months ago

How can I use astro-seo in markdown files?

I am using Astro Starlight and would love to display custom tags defined in my Frontmatter.

For example

<meta property="fc:frame" content="vNext" />

when using Starlight to extend head I can't get it in there as in my .md

title: "My sample .md"
head:
  - tag: meta
    content: vNext

doesn't give me the equivalent as it's missing property

How would I do this with astro-seo? in .astro pages I could use the SEO component and pass the extended meta tags though I can't use components in .md files and would love to do it in frontmatter

is there a solution potentially with just pure .md? or if not then with .mdx?

migsar commented 3 weeks ago

This is related to Starlight and not to astro-seo, you can use any frontmatter property in the layout you create for rendering your markdown files. I am using astro-seo from md files for my blog without any problem.

I am not familiar with Starlight but take a look at Head.astro in their repo as it is there where the seo info is inserted, but I don't think they are using astro-seo.