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

Any chance of a code snippet of assigning the constants and calling them in the page template? #97

Open danielrosehill opened 1 month ago

danielrosehill commented 1 month ago

I've been going around in circles for a while trying to figure this out!

I'm integrating the component into a site built off of an Astro template.

To test it out, in index.astro I set:

const title="Daniel Homepage";

In header.astro I call:

import { SEO } from "astro-seo";

And I tried:

<SEO title={title}

But I get:

ReferenceError An error occurred. title is not defined

I've been using the code snippet from the repo but that has the dummy values of course

Is there nay way you could show a working example with a "typical" Header -> Layout -> Page hierarchy?