Skip to content

Spanish translations #4276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docusaurus.config.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const config = {
trailingSlash: false,
i18n: {
defaultLocale: "en",
locales: ["en", "jp", "zh", "ru"],
locales: ["en", "jp", "zh", "ru", "es"],
path: "i18n",
localeConfigs: {
en: {
Expand All @@ -84,6 +84,11 @@ const config = {
label: "Русский",
htmlLang: "ru",
path: "ru",
},
es: {
label: "Español",
htmlLang: "es",
path: "es",
}
},
},
Expand Down
373 changes: 373 additions & 0 deletions docusaurus.config.es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,373 @@
import { themes } from "prism-react-renderer";
import math from "remark-math";
import katex from "rehype-katex";
import chHeader from "./plugins/header.js";
import fixLinks from "./src/hooks/fixLinks.js";
const path = require('path');
const remarkCustomBlocks = require('./plugins/remark-custom-blocks.js');

// Import custom plugins
const { customParseFrontMatter } = require('./plugins/frontmatter-validation/customParseFrontMatter.js');
const checkFloatingPages = require('./plugins/checkFloatingPages.js');
const frontmatterValidator = require('./plugins/frontmatter-validation/frontmatterValidatorPlugin.js');
import pluginLlmsTxt from './plugins/llms-txt-plugin.ts'
import prismLight from "./src/utils/prismLight.ts";
import prismDark from "./src/utils/prismDark.ts";
import glossaryTransformer from "./plugins/glossary-transformer.js";

// Helper function to skip over index.md files.
function skipIndex(items) {
return items.filter(({ type, id }) => {
return type !== "doc" || !id.match(/index$/);
});
}

/** @type {import('@docusaurus/types').Config} */
const config = {
scripts: [
{
src: "/docs/js/kapa_config.js",
async: false,
},
{
src: "/docs/js/kapa_widget.js",
async: true,
defer: true, // execute after document parsing, but before firing DOMContentLoaded event
},
],
// Settings for Docusaurus Faster - build optimizations
future: {
experimental_faster: {
swcJsLoader: true,
swcJsMinimizer: true,
swcHtmlMinimizer: true,
lightningCssMinimizer: true,
rspackBundler: true,
mdxCrossCompilerCache: true,
},
},
title: "ClickHouse Docs",
tagline:
"Documentation, quick starts, user guides, technical references, FAQs and more...",
url: "https://clickhouse.com",
// url: process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : 'https://bookish-disco-5997zvo.pages.github.io',
baseUrl: "/docs/",
baseUrlIssueBanner: true,
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
onDuplicateRoutes: "throw",
onBrokenAnchors: "throw",
favicon: "img/docs_favicon.ico",
organizationName: "ClickHouse",
trailingSlash: false,
i18n: {
defaultLocale: "en",
locales: ["en", "jp", "zh", "ru", "es"],
path: "i18n",
localeConfigs: {
en: {
label: "English",
htmlLang: "en",
path: "en",
},
jp: {
label: "日本語",
htmlLang: "jp",
path: "jp",
},
zh: {
label: "中文",
htmlLang: "zh",
path: "zh",
},
ru: {
label: "Русский",
htmlLang: "ru",
path: "ru",
},
es: {
label: "Español",
htmlLang: "es",
path: "es",
}
},
},
staticDirectories: ["static"],
projectName: "clickhouse-docs",
markdown: {
mermaid: true,
parseFrontMatter: async (params) => {
return await customParseFrontMatter(params);
}
},
themes: ["@docusaurus/theme-mermaid"],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
admonitions: {
keywords: [
"note",
"tip",
"info",
"caution",
"danger",
"experimental",
"obsolete",
"warning",
"success",
"important",
"secondary",
],
},
sidebarPath: require.resolve("./sidebars.js"),
// Implements a custom sidebar to override default behaviour where index.md page shows underneath the category name.
// With this sidebar the category name is clickable to show the index.md contents.
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
return skipIndex(sidebarItems);
},
editCurrentVersion: true,
breadcrumbs: true,
editUrl: ({ docPath }) => {
if (docPath === "index.md") return false;
if (
docPath.includes("development") ||
docPath.includes("engines") ||
docPath.includes("interfaces") ||
docPath.includes("operations") ||
docPath.includes("sql-reference")
) {
return (
"https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/" +
docPath
);
} else {
return (
"https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/" +
docPath
);
}
},
showLastUpdateTime: false,
sidebarCollapsed: true,
routeBasePath: "/",
remarkPlugins: [math, remarkCustomBlocks, glossaryTransformer],
beforeDefaultRemarkPlugins: [fixLinks],
rehypePlugins: [katex],
},
blog: {
path: "knowledgebase",
blogTitle: "ClickHouse Knowledge Base",
blogDescription: "Knowledge Base",
blogSidebarTitle: "All KB articles",
routeBasePath: "/knowledgebase",
postsPerPage: 10,
blogSidebarCount: "ALL",
feedOptions: {
type: "all",
title: "ClickHouse Knowledge Base Feed",
description:
"Feed of articles posted to the ClickHouse Knowledge Base",
copyright: `Copyright © 2016–${new Date().getFullYear()} ClickHouse, Inc. ClickHouse Docs provided under the Creative Commons CC BY-NC-SA 4.0 license. ClickHouse® is a registered trademark of ClickHouse, Inc.`,
language: "en",
createFeedItems: async (params) => {
const { blogPosts, defaultCreateFeedItems, ...rest } = params;
return defaultCreateFeedItems({
// keep only the 10 most recent blog posts in the feed
blogPosts: blogPosts.filter((item, index) => index < 10),
...rest,
});
},
},
editUrl: ({ blogPath }) => {
return (
"https://github.com/ClickHouse/clickhouse-docs/blob/main/knowledgebase/" +
blogPath
);
},
},
pages: {

},
theme: {
customCss: [require.resolve("./src/css/custom.scss")],
},
googleTagManager: {
containerId: 'GTM-WTNTDT7W',
},
}),
],
],
// Inserts tags into the <head></head>
headTags: [
{
// Ask AI component
tagName: "link",
attributes: {
href: "https://widget.kapa.ai",
rel: "preconnect", // preemptively initiate a connection to resource
},
},
{
// Google's CDN. Caches all 'static' files in a server near to you
// to reduce load times.
tagName: "link",
attributes: {
href: "https://www.gstatic.com",
rel: "preconnect",
crossorigin: "use-credentials",
},
},
{
tagName: "link",
attributes: {
href: "https://www.googletagmanager.com",
rel: "preconnect",
},
},
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
metadata: [
{name: 'Accept-Language', content: 'en-US,en;q=0.9'},
],
algolia: {
appId: "5H9UG7CX5W",
apiKey: "4a7bf25cf3edbef29d78d5e1eecfdca5",
indexName: "clickhouse",
contextualSearch: false,
searchPagePath: "search",
},
image: "img/docs_social_share.png",
icon: "/img/gareth.png",
docs: {
sidebar: {
autoCollapseCategories: true,
},
},
// autoCollapseSidebarCategories: true,
navbar: {
hideOnScroll: false,
logo: {
alt: "ClickHouse",
src: "img/ch_logo_docs.svg",
srcDark: "img/ch_logo_docs_dark.svg",
href: "https://clickhouse.com/",
},
items: [],
},
footer: {
style: "light",
links: [
{
label: "Trademark",
to: "https://clickhouse.com/legal/trademark-policy",
},
{
label: "Privacy",
to: "https://clickhouse.com/legal/privacy-policy",
},
{
label: "Security",
to: "https://trust.clickhouse.com/",
},
{
label: "Terms of Service",
to: "https://clickhouse.com/legal/agreements/terms-of-service",
},
],
copyright: `© 2016&ndash;${new Date().getFullYear()} ClickHouse, Inc.`,
},
prism: {
theme: prismLight,
darkTheme: prismDark,
additionalLanguages: ["java", "cpp", "rust", "python", "javascript", "yaml", "bash", "docker", "csharp"],
magicComments: [
// Remember to extend the default highlight class name as well!
{
className: "theme-code-block-highlighted-line",
line: "highlight-next-line",
block: { start: "highlight-start", end: "highlight-end" },
},
],
},
colorMode: {
disableSwitch: false,
respectPrefersColorScheme: true,
defaultMode: "dark",
},
}),

plugins: [
"docusaurus-plugin-sass",
function (context, options) {
return {
name: "docusaurus-plugin",
async postBuild({ siteConfig = {}, routesPaths = [], outDir }) {
// Print out to console all the rendered routes.
routesPaths.map((route) => {
//console.log(route)
});
},
};
},
// [
// N.B - If you need to redirect a page please do so from vercel.json
// '@docusaurus/plugin-client-redirects',
// {
// },
// ],
[
"vercel-analytics",
{
debug: false,
mode: "auto",
},
],
chHeader,
[
'@docusaurus/plugin-ideal-image',
{
quality: 85,
sizes: [48, 300, 600, 1024, 2048],
disableInDev: false,
},
],
[
frontmatterValidator,
{
failBuild: true
},
],
[
checkFloatingPages,
{
failBuild: true,
exceptionsFile: path.resolve(__dirname, 'plugins/floating-pages-exceptions.txt')
},
],
[
pluginLlmsTxt,
{}
],
[
'./plugins/tailwind-config.js',
{}
]
],
customFields: {
blogSidebarLink: "/docs/knowledgebase", // Used for KB article page
galaxyApiEndpoint:
process.env.NEXT_PUBLIC_GALAXY_API_ENDPOINT || "http://localhost:3000",
},

};

module.exports = config;
Loading
Loading