You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2024/11/04 12:35:50 UTC
(kylin) 01/11: add i18n and use `docusaurus-plugin-search-local` replace `@cmfcmf/docusaurus-search-local`
This is an automated email from the ASF dual-hosted git repository.
liyang pushed a commit to branch doc5.0
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 2e5eda7e13320b5544e3e523ab319e596052c1ea
Author: jlf <12...@qq.com>
AuthorDate: Tue Oct 22 16:07:09 2024 +0800
add i18n and use `docusaurus-plugin-search-local` replace `@cmfcmf/docusaurus-search-local`
---
website/docs/deployment/cluster_mode.md | 2 +-
website/docusaurus.config.ts | 77 ++++++------------------
website/package.json | 4 +-
website/src/components/HomepageFeatures/index.js | 6 +-
website/src/data/features.tsx | 36 +++++------
website/src/pages/index.js | 9 +--
6 files changed, 50 insertions(+), 84 deletions(-)
diff --git a/website/docs/deployment/cluster_mode.md b/website/docs/deployment/cluster_mode.md
index dfef494024..cc93fa403a 100644
--- a/website/docs/deployment/cluster_mode.md
+++ b/website/docs/deployment/cluster_mode.md
@@ -26,7 +26,7 @@ In the above diagram, the components which require user deployment are below:
### Configure Metadata DB
-Kylin uses RDBMS to store metadata, please refer to [Use RDBMS as Metastore](./rdbms_metastore/intro.md).
+Kylin uses RDBMS to store metadata, please refer to [Use RDBMS as Metastore](./intro.md).
### Kylin Server
diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts
index 8283bb668e..98da9bf209 100644
--- a/website/docusaurus.config.ts
+++ b/website/docusaurus.config.ts
@@ -48,7 +48,7 @@ function getAnnouncedVersion() {
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Apache Kylin',
- tagline: 'Kylin is a high concurrency, high performance and intelligent OLAP engine that provides low-cost and ultimate data analytics experience .',
+ tagline: 'Kylin is a high concurrency, high performance and intelligent OLAP engine that provides low-cost and ultimate data analytics experience.',
url: 'https://kylin.apache.org',
baseUrl: '',
onBrokenLinks: 'warn',
@@ -65,73 +65,18 @@ const config = {
plugins: [
[
- require.resolve("@cmfcmf/docusaurus-search-local"),
+ require.resolve("docusaurus-plugin-search-local"),
{
// Options here
// whether to index docs pages
indexDocs: true,
- // Whether to also index the titles of the parent categories in the sidebar of a doc page.
- // 0 disables this feature.
- // 1 indexes the direct parent category in the sidebar of a doc page
- // 2 indexes up to two nested parent categories of a doc page
- // 3...
- //
- // Do _not_ use Infinity, the value must be a JSON-serializable integer.
- indexDocSidebarParentCategories: 0,
-
// whether to index blog pages
indexBlog: true,
// whether to index static pages
// /404.html is never indexed
indexPages: false,
-
- // language of your documentation, see next section
- language: "en",
-
- // setting this to "none" will prevent the default CSS to be included. The default CSS
- // comes from autocomplete-theme-classic, which you can read more about here:
- // https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-theme-classic/
- // When you want to overwrite CSS variables defined by the default theme, make sure to suffix your
- // overwrites with `!important`, because they might otherwise not be applied as expected. See the
- // following comment for more information: https://github.com/cmfcmf/docusaurus-search-local/issues/107#issuecomment-1119831938.
- style: undefined,
-
- // The maximum number of search results shown to the user. This does _not_ affect performance of
- // searches, but simply does not display additional search results that have been found.
- maxSearchResults: 8,
-
- // lunr.js-specific settings
- lunr: {
- // When indexing your documents, their content is split into "tokens".
- // Text entered into the search box is also tokenized.
- // This setting configures the separator used to determine where to split the text into tokens.
- // By default, it splits the text at whitespace and dashes.
- //
- // Note: Does not work for "ja" and "th" languages, since these use a different tokenizer.
- tokenizerSeparator: /[\s\-]+/,
- // https://lunrjs.com/guides/customising.html#similarity-tuning
- //
- // This parameter controls the importance given to the length of a document and its fields. This
- // value must be between 0 and 1, and by default it has a value of 0.75. Reducing this value
- // reduces the effect of different length documents on a term’s importance to that document.
- b: 0.75,
- // This controls how quickly the boost given by a common word reaches saturation. Increasing it
- // will slow down the rate of saturation and lower values result in quicker saturation. The
- // default value is 1.2. If the collection of documents being indexed have high occurrences
- // of words that are not covered by a stop word filter, these words can quickly dominate any
- // similarity calculation. In these cases, this value can be reduced to get more balanced results.
- k1: 1.2,
- // By default, we rank pages where the search term appears in the title higher than pages where
- // the search term appears in just the text. This is done by "boosting" title matches with a
- // higher value than content matches. The concrete boosting behavior can be controlled by changing
- // the following settings.
- titleBoost: 5,
- contentBoost: 1,
- tagsBoost: 3,
- parentCategoriesBoost: 2, // Only used when indexDocSidebarParentCategories > 0
- }
},
],
],
@@ -141,7 +86,19 @@ const config = {
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
- locales: ['en'],
+ // locales: ['en'],
+ locales: ['en', 'zh-Hans'],
+ // path: 'i18n',
+ localeConfigs: {
+ // 'en': {
+ // label: 'English',
+ // htmlLang: 'en-GB',
+ // },
+ 'zh-Hans': {
+ label: '简体中文',
+ path: 'zh-Hans',
+ },
+ },
},
presets: [
@@ -269,6 +226,10 @@ const config = {
position: 'left',
label: 'Development',
},
+ {
+ type: 'localeDropdown',
+ position: 'right',
+ },
{
type: 'doc',
docId: 'download',
diff --git a/website/package.json b/website/package.json
index f8060963c5..e63ad5f7bc 100644
--- a/website/package.json
+++ b/website/package.json
@@ -14,7 +14,7 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
- "@cmfcmf/docusaurus-search-local": "^1.2.0",
+ "docusaurus-plugin-search-local": "^2.1.0",
"@eightshift/ui-components": "^1.2.2",
"@infinum/docusaurus-theme": "^0.5.0",
"@docusaurus/core": "^3.5.2",
@@ -31,7 +31,7 @@
"@docusaurus/types": "^3.5.2"
},
"overrides": {
- "@cmfcmf/docusaurus-search-local": {
+ "docusaurus-plugin-search-local": {
"@docusaurus/core": "^3.5.2"
}
},
diff --git a/website/src/components/HomepageFeatures/index.js b/website/src/components/HomepageFeatures/index.js
index a5d6eee72f..4505e90cd5 100644
--- a/website/src/components/HomepageFeatures/index.js
+++ b/website/src/components/HomepageFeatures/index.js
@@ -3,6 +3,8 @@ import clsx from 'clsx';
import styles from './styles.module.css';
import FeatureList from '@site/src/data/features.tsx'
+import Translate, {translate} from '@docusaurus/Translate';
+
function Feature({Svg, title, description}) {
return (
<div className={clsx('col col--4')}>
@@ -29,7 +31,7 @@ const home_arc = [
function Homearc({Svg, title}) {
return (
<div className={clsx('col')}>
- <h1 className="text--center padding-horiz--md">Apache Kylin Overview</h1>
+ <h1 className="text--center padding-horiz--md"><Translate>Apache Kylin Overview</Translate></h1>
<Svg className={styles.homearc} role="img"/>
</div>
);
@@ -40,7 +42,7 @@ export default function HomepageFeatures() {
<div>
<section className={styles.features}>
<div className="container">
- <h1 className="text--center padding-horiz--md">Key Features</h1>
+ <h1 className="text--center padding-horiz--md"><Translate>Key Features</Translate></h1>
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
diff --git a/website/src/data/features.tsx b/website/src/data/features.tsx
index e331147ab8..f8743887b9 100644
--- a/website/src/data/features.tsx
+++ b/website/src/data/features.tsx
@@ -1,64 +1,66 @@
import React from "react";
+import Translate, {translate} from '@docusaurus/Translate';
+
const FeatureList = [
{
- title: 'Ultra Fast Query Experience',
+ title: <Translate>Ultra Fast Query Experience</Translate>,
Svg: require('@site/static/img/homepage/fast.svg').default,
description: (
<>
- Provide sub-second query performance based on advanced pre-calculation technology.
- Support large-scale, high concurrency data analytics with low hardware and development cost.
+ <Translate>Provide sub-second query performance based on advanced pre-calculation technology.</Translate>
+ <Translate>Support large-scale, high concurrency data analytics with low hardware and development cost.</Translate>
</>
),
},
{
- title: 'Model & Index Recommendation',
+ title: <Translate>Model & Index Recommendation</Translate>,
Svg: require('@site/static/img/homepage/paperplane.svg').default,
description: (
<>
- Modeling with SQL text & automatic index optimization based on query history.
- More intelligent and easier for user to get started.
+ <Translate>Modeling with SQL text & automatic index optimization based on query history.</Translate>
+ <Translate>More intelligent and easier for user to get started.</Translate>
</>
),
},
{
- title: 'Internal Table with Native Compute Engine',
+ title: <Translate>Internal Table with Native Compute Engine</Translate>,
Svg: require('@site/static/img/homepage/plugin.svg').default,
description: (
<>
- More flexible query analysis based on internal table.
- Integrates Apache Gluten as native compute engine, delivering over a 2x improvement in performance .
+ <Translate>More flexible query analysis based on internal table.</Translate>
+ <Translate>Integrates Apache Gluten as native compute engine, delivering over a 2x improvement in performance.</Translate>
</>
),
},
{
- title: 'Powerful Data Warehouse Capabilities',
+ title: <Translate>Powerful Data Warehouse Capabilities</Translate>,
Svg: require('@site/static/img/homepage/warehouse.svg').default,
description: (
<>
- Advanced multi-dimensional analysis, various data functions.
- Support connecting to different BI tools, like Tableau/Power BI/Excel.
+ <Translate>Advanced multi-dimensional analysis, various data functions.</Translate>
+ <Translate>Support connecting to different BI tools, like Tableau/Power BI/Excel.</Translate>
</>
),
},
{
- title: 'Streaming-Batch Fusion Analysis',
+ title: <Translate>Streaming-Batch Fusion Analysis</Translate>,
Svg: require('@site/static/img/homepage/streaming.svg').default,
description: (
<>
- New designed streaming/fusion model capability, reducing data analysis latency to seconds-minutes level.
- Support fusion analysis with batch data, which brings more accurate and reliable results.
+ <Translate>New designed streaming/fusion model capability, reducing data analysis latency to seconds-minutes level.</Translate>
+ <Translate>Support fusion analysis with batch data, which brings more accurate and reliable results.</Translate>
</>
),
},
{
- title: 'Brand New Web UI',
+ title: <Translate>Brand New Web UI</Translate>,
Svg: require('@site/static/img/homepage/web.svg').default,
description: (
<>
- The new modeling process is concise, allowing users to define table relationships, dimensions, and measures on a single canvas.
+ <Translate>The new modeling process is concise, allowing users to define table relationships, dimensions, and measures on a single canvas.</Translate>
</>
),
},
diff --git a/website/src/pages/index.js b/website/src/pages/index.js
index cd5de277cb..d2461a54c5 100644
--- a/website/src/pages/index.js
+++ b/website/src/pages/index.js
@@ -6,24 +6,25 @@ import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures';
import styles from './index.module.css';
+import Translate, {translate} from '@docusaurus/Translate';
function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
return (
<header className={clsx(styles.heroBanner)}>
<div className={styles.container}>
- <h1 className={styles.title}>Smarter and Faster</h1>
- <p className={styles.subtitle}>{siteConfig.tagline}</p>
+ <h1 className={styles.title}><Translate>Smarter and Faster</Translate></h1>
+ <p className={styles.subtitle}><Translate>{siteConfig.tagline}</Translate></p>
<br/>
<div>
<Link className={clsx("button button--lg button--secondary", styles.buttons)}
to="/docs/overview">
- What's New
+ <Translate>What's New</Translate>
</Link>
<span>   </span>
<Link className={clsx("button button--lg button--secondary", styles.buttons1)}
to="/docs/quickstart/intro">
- Play in Docker
+ <Translate>Play in Docker</Translate>
</Link>
</div>
</div>