This is an automated email from the ASF dual-hosted git repository.
bhavanisudha pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/asf-site by this push:
new cbeff1cb9ca fix: update home page title (#11530)
cbeff1cb9ca is described below
commit cbeff1cb9ca3b7327cebfe6a032e354568ce72c5
Author: pintusoliya <[email protected]>
AuthorDate: Thu Jul 11 04:15:29 2024 +0530
fix: update home page title (#11530)
fix: merge conflicts
fix: title
---
website/src/pages/index.js | 7 +++----
website/src/theme/LayoutHead/index.js | 7 ++++---
website/src/theme/LayoutHead/useTitleFormatter.js | 14 ++++++++++++++
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/website/src/pages/index.js b/website/src/pages/index.js
index ed6f4f9d050..faa5eefbcd4 100644
--- a/website/src/pages/index.js
+++ b/website/src/pages/index.js
@@ -24,10 +24,9 @@ export default function Home() {
const { siteConfig } = useDocusaurusContext();
return (
<Layout
- title={`Hello from ${siteConfig.title}`}
- description="Description will go into a meta tag in <head />"
- wrapperClassName={styles.homePage}
- >
+ title={`Apache Hudi | An Open Source Data Lake Platform`}
+ shouldShowOnlyTitle={true}
+ description="Description will go into a meta tag in <head />">
<NewReleaseMessage />
<HomepageHeader />
<main>
diff --git a/website/src/theme/LayoutHead/index.js
b/website/src/theme/LayoutHead/index.js
index d0841677f5b..7c3abb4d2de 100644
--- a/website/src/theme/LayoutHead/index.js
+++ b/website/src/theme/LayoutHead/index.js
@@ -12,10 +12,10 @@ import SearchMetadata from '@theme/SearchMetadata';
import Seo from '@theme/Seo';
import {
DEFAULT_SEARCH_TAG,
- useTitleFormatter,
useAlternatePageUtils,
useThemeConfig,
} from '@docusaurus/theme-common';
+import { useTitleFormatter } from './useTitleFormatter';
import {useLocation} from '@docusaurus/router'; // Useful for SEO
// See
https://developers.google.com/search/docs/advanced/crawling/localized-versions
// See https://github.com/facebook/docusaurus/issues/3317
@@ -82,9 +82,10 @@ export default function LayoutHead(props) {
i18n: {currentLocale, localeConfigs},
} = useDocusaurusContext();
const {metadata, image: defaultImage} = useThemeConfig();
- const {title, description, image, keywords, searchMetadata} = props;
+ const {title, description, image, keywords, searchMetadata,
shouldShowOnlyTitle} = props;
const faviconUrl = useBaseUrl(favicon);
- const pageTitle = useTitleFormatter(title); // See
https://github.com/facebook/docusaurus/issues/3317#issuecomment-754661855
+ const pageTitle = useTitleFormatter(title, shouldShowOnlyTitle); // See
https://github.com/facebook/docusaurus/issues/3317#issuecomment-754661855
+
// const htmlLang = currentLocale.split('-')[0];
const htmlLang = currentLocale; // should we allow the user to override
htmlLang with localeConfig?
diff --git a/website/src/theme/LayoutHead/useTitleFormatter.js
b/website/src/theme/LayoutHead/useTitleFormatter.js
new file mode 100644
index 00000000000..ee628fc29cc
--- /dev/null
+++ b/website/src/theme/LayoutHead/useTitleFormatter.js
@@ -0,0 +1,14 @@
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+
+export const useTitleFormatter = (title, shouldShowOnlyTitle)=> {
+ const {siteConfig} = useDocusaurusContext();
+ const {title: siteTitle, titleDelimiter} = siteConfig;
+
+ if (shouldShowOnlyTitle && title && title.trim().length) {
+ return title.trim();
+ }
+
+ return title && title.trim().length
+ ? `${title.trim()} ${titleDelimiter} ${siteTitle}`
+ : siteTitle;
+};