Replies: 1 comment 5 replies
-
TLDR: The global metadata you declare this way is metadata that applies to your whole site, and can be overridden by your theme on a case-by-case basis (usually per-page basis). It is not particularly a good practice to use the exact same description metadata for your whole site. After all, all pages of your site are different and should have a different description. So each individual page of our classic theme will override the description you add If you want to customize the page-specific description metadata that our theme provides, you'd have to swizzle the respective page components and provide your own logic. For the blog home page, according to our current code, you should use function BlogListPageMetadata(props: Props): JSX.Element {
const {metadata} = props;
const {
siteConfig: {title: siteTitle},
} = useDocusaurusContext();
const {blogDescription, blogTitle, permalink} = metadata;
const isBlogOnlyMode = permalink === '/';
const title = isBlogOnlyMode ? siteTitle : blogTitle;
return (
<>
<PageMetadata title={title} description={blogDescription} />
<SearchMetadata tag="blog_posts_list" />
</>
);
} If you don't like this logic, you can swizzle the |
Beta Was this translation helpful? Give feedback.
-
I'm using Docusaurus to host a blog.
I'm trying to add global metadata to my site - the relevant part of my theme config looks like this
However, the generated tags have something else. Note that I am seeing this problem with only the main page, not the individual posts. The individual posts pick up the description correctly from the post markdown.
What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions