This is an automated email from the ASF dual-hosted git repository.
Yilialinn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/master by this push:
new f0fadc6b94d feat: give the Learning Center index its own meta
description (#2071)
f0fadc6b94d is described below
commit f0fadc6b94dcc893e839f499af9b0d0be410475b
Author: Ming Wen <[email protected]>
AuthorDate: Mon Jul 13 15:39:20 2026 +0800
feat: give the Learning Center index its own meta description (#2071)
---
website/docusaurus.config.js | 2 ++
website/src/theme/BlogListPage/index.tsx | 37 ++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index bcb4dc38001..8061dc83066 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -103,6 +103,8 @@ module.exports = {
blogSidebarCount: 'ALL',
blogSidebarTitle: 'Learning Center',
blogTitle: 'Learning Center',
+ blogDescription:
+ 'Practical guides to API gateway concepts — authentication, rate
limiting, security, mutual TLS — plus comparisons of Apache APISIX with Kong,
Envoy, and NGINX.',
showReadingTime: true,
},
],
diff --git a/website/src/theme/BlogListPage/index.tsx
b/website/src/theme/BlogListPage/index.tsx
new file mode 100644
index 00000000000..88b5e3ac7b0
--- /dev/null
+++ b/website/src/theme/BlogListPage/index.tsx
@@ -0,0 +1,37 @@
+import React from 'react';
+import BlogListPage from '@theme-original/BlogListPage';
+import Head from '@docusaurus/Head';
+
+/**
+ * Wraps the default blog list page so the Learning Center index carries its
+ * own meta description. The description passed through Layout props is
+ * rendered inside LayoutHead, where the trailing themeConfig `metadatas`
+ * block deliberately overrides it with the site-wide default; a <Head>
+ * rendered here sits after LayoutHead in the tree, so react-helmet lets it
+ * win. Other blog instances (events, articles) are rendered untouched.
+ */
+
+type Props = React.ComponentProps<typeof BlogListPage> & {
+ metadata: { permalink: string; blogDescription: string };
+};
+
+const LEARNING_CENTER_PREFIX = '/learning-center';
+
+const BlogListPageWrapper: React.FC<Props> = (props) => {
+ const { metadata } = props;
+ const isLearningCenter =
metadata.permalink.startsWith(LEARNING_CENTER_PREFIX);
+
+ return (
+ <>
+ <BlogListPage {...props} />
+ {isLearningCenter && metadata.blogDescription && (
+ <Head>
+ <meta name="description" content={metadata.blogDescription} />
+ <meta property="og:description" content={metadata.blogDescription} />
+ </Head>
+ )}
+ </>
+ );
+};
+
+export default BlogListPageWrapper;