Replies: 2 comments 4 replies
-
You can implement it by internal Helmet component. Doc: https://rspress.dev/api/client-api/api-components.html#helmet |
Beta Was this translation helpful? Give feedback.
-
Asking for support into creating a plugin for adding open graph tags based on the front matter definitions (title, description, icon...). Initial idea was that I can hook into Rspress via plugin, get a callback for each of the page being generated and return the appropriate html tags that will get added at the end by Rsbuild (similar to Can anyone give some hint on how to go about creating such plugin? ping @sanyuan0704 ? For the time being, I am taking the aproach of defining custom theme Layout so I can inject headers via the Helmet component: const Layout = () => {
const pageData = usePageData();
console.log({ pageData });
return (
<>
<Helmet>
<meta property="og:title" content={`${pageData.page.title}`} />
<meta property="og:url" content={`https://mysite.com/${pageData.page.pagePath}`} />
</Helmet>
<Theme.Layout />
</>
);
}; |
Beta Was this translation helpful? Give feedback.
-
Hello,
I really like rspress and deployed my blog via cf-workers, but I am missing the feature to create open graph tags. Does anyone know how to implement it?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions