Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
This guide assumes you know what Farcaster Frames are, but even if you don’t you can follow the guide to implement one for authentication to your app.
We will setup Astro Starlight to provide two links clickable in Farcaster Frames defined in Astro YAML Frontmatter or using our default frame for the whole webpage. This will not handle any post requests though you can also do that of course by adding a post_url and handling the incoming request making your Astro Frame we define in the YAML Frontmatter serve as the inital Frame that hands over to your Server.
The Frame we will be creating looks like the one shown in the image below:
We just need to adjust two Files for our Astro Starlight Webpage/Documentation to support Farcaster Frames. This method can also be extended to any custom html head or html metatag like OpenGraph or OpenFrames in Astro Starlight.
Firstly we will create a config that contains the extended Frontmatter configuration so we don’t need to write html or javascript over and over again for our Frames.
Simply open/create your config file and paste the contents
src/content/config.ts
Then create a custom Head component or edit yours to include the Farcaster Frames Tags that are adjusted based on the Frontmatter of our Document.
If a value like Button3 is not set in our File, we will only return our default buttons. In the sample below we show two buttons.
You could use this to have a link to page and promotion button next to it, our show link to blog post and link to youtube video from the same URL!
Just create the file at the right path and copy the contents below. Adjust to your liking if needed.
src/components/Head.astro
Using the Frame in our Astro Website
We will use a simple markdown page here, but this also works in .mdx and .astro pages as it just leverages the YAML Frontmatter!
Final Remarks
Make sure that your image is accessible and the paths are correct!
Astro will make filenames be lower case so FramesQuickstart.md will be /framesquickstart in the link! Make sure you set that correctly in the frame.
If you want to learn more about Frames and build custom frames that handle Request and use a Frame Server instead of just linking out check our quickstart with Frames guide!