Skip to content

New docs home page #4289

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

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f55ff87
add page and basic components
Blargian Jun 23, 2025
7775aae
improve styling
Blargian Jun 23, 2025
3a7321b
more styling
Blargian Jun 24, 2025
6b5ac18
Merge branch 'main' of https://github.com/ClickHouse/clickhouse-docs …
Blargian Jul 8, 2025
5d2a645
fix styling for mobile
Blargian Aug 5, 2025
7a6953f
Merge branch 'main' of https://github.com/ClickHouse/clickhouse-docs …
Blargian Aug 5, 2025
13655a6
integrate material-ui and use it on homepage
Blargian Aug 5, 2025
e25bf3a
improve layout
Blargian Aug 5, 2025
20152c2
correct spacing
Blargian Aug 5, 2025
56ce07d
more layout tweaks
Blargian Aug 5, 2025
85bf3be
more improvements
Blargian Aug 16, 2025
1da4de6
more styling improvements
Blargian Aug 16, 2025
f768362
make test page the new homepage
Blargian Aug 16, 2025
44efd05
get Ask AI widget working
Blargian Aug 16, 2025
8349b6e
fix z-indexing bug by giving footer a higher z-index
Blargian Aug 16, 2025
d9bb5da
fix footer issue in both light and dark mode
Blargian Aug 16, 2025
09cc0d0
new logo, remove later
Blargian Aug 16, 2025
3165284
update links
Blargian Aug 17, 2025
7734a7f
move changelogs right
Blargian Aug 19, 2025
c71a153
update layout based on feedback
Blargian Aug 19, 2025
8c748f2
update layout
Blargian Aug 19, 2025
64763c5
ordering fixes
Blargian Aug 20, 2025
2092a3b
add featured section
Blargian Aug 20, 2025
3d8db29
fix background
Blargian Aug 20, 2025
23b3501
styling improvements for light mode
Blargian Aug 20, 2025
a5bc0e8
Merge branch 'main' into revamp_docs_homepage
Blargian Aug 20, 2025
af06b07
Update beta-settings.sql
Blargian Aug 20, 2025
44253eb
save yarn lock
Blargian Aug 20, 2025
d84c1e4
fix
Blargian Aug 20, 2025
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
1 change: 1 addition & 0 deletions docusaurus.config.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ const config = {

plugins: [
"docusaurus-plugin-sass",
"./plugins/version-extractor",
function (context, options) {
return {
name: "docusaurus-plugin",
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
"@docusaurus/preset-classic": "3.7.0",
"@docusaurus/theme-mermaid": "3.7.0",
"@docusaurus/theme-search-algolia": "^3.7.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mdx-js/react": "^3.1.0",
"@mui/material": "^7.3.0",
"@mui/styled-engine-sc": "^7.3.0",
"@radix-ui/react-navigation-menu": "^1.2.13",
"@redocly/cli": "^1.34.0",
"axios": "^1.11.0",
Expand Down Expand Up @@ -73,6 +77,7 @@
"sass": "^1.89.1",
"search-insights": "^2.17.3",
"short-uuid": "^5.2.0",
"styled-components": "^6.1.19",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
Expand Down
138 changes: 138 additions & 0 deletions plugins/version-extractor/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
const fs = require('fs');
const path = require('path');

function extractVersions(siteDir) {
// Extract latest OSS version from index.md (2025 changelog)
function getLatestOSSVersion() {
try {
// Check 2025 changelog first (index.md)
const changelog2025Path = path.join(siteDir, 'docs/whats-new/changelog/index.md');
if (fs.existsSync(changelog2025Path)) {
const content = fs.readFileSync(changelog2025Path, 'utf8');

// Look for the first version pattern like "25.7"
const versionMatch = content.match(/ClickHouse release v(\d+\.\d+)/);
if (versionMatch) {
const version = versionMatch[1];
// Create anchor link (e.g., "25.7" -> "#257")
const anchor = version.replace('.', '');
return {
version: `v${version}`,
link: `/docs/whats-new/changelog#${anchor}`
};
}
}

// Fallback to 2024 changelog
const changelog2024Path = path.join(siteDir, 'docs/whats-new/changelog/2024.md');
const content = fs.readFileSync(changelog2024Path, 'utf8');

// Look for the first version pattern like "24.12"
const versionMatch = content.match(/ClickHouse release (?:v)?(\d+\.\d+)/);
const version = versionMatch ? versionMatch[1] : '24.12.1';
return {
version: `v${version}`,
link: `/docs/whats-new/changelog/2024`
};
} catch (error) {
console.warn('Could not extract OSS version:', error.message);
return {
version: 'v25.7',
link: '/docs/whats-new/changelog#257'
};
}
}

// Extract latest Cloud version from changelog directory
function getLatestCloudVersion() {
try {
const changelogDir = path.join(siteDir, 'docs/cloud/changelogs');
const files = fs.readdirSync(changelogDir)
.filter(file => file.endsWith('.md'))
.map(file => {
const match = file.match(/(\d+)_(\d+)\.md$/);
if (match) {
// Convert "06" to "6", "04" to "4", etc.
const major = match[1];
const minor = parseInt(match[2], 10).toString();
return {
version: `${major}.${minor}`,
file: file,
link: `/docs/changelogs/${major}.${minor}`
};
}
return null;
})
.filter(Boolean)
.sort((a, b) => {
// Sort by version number (descending)
const [aMajor, aMinor] = a.version.split('.').map(Number);
const [bMajor, bMinor] = b.version.split('.').map(Number);

if (aMajor !== bMajor) return bMajor - aMajor;
return bMinor - aMinor;
});

if (files.length > 0) {
return {
version: `v${files[0].version}`,
link: files[0].link
};
}

return {
version: 'v25.6',
link: '/docs/changelogs/25.6'
};
} catch (error) {
console.warn('Could not extract Cloud version:', error.message);
return {
version: 'v25.6',
link: '/docs/changelogs/25.6'
};
}
}

const ossVersionInfo = getLatestOSSVersion();
const cloudVersionInfo = getLatestCloudVersion();

return {
oss: {
version: ossVersionInfo.version,
link: ossVersionInfo.link
},
cloud: {
version: cloudVersionInfo.version,
link: cloudVersionInfo.link
},
generatedAt: new Date().toISOString()
};
}

module.exports = function versionExtractorPlugin(context, options) {
return {
name: 'version-extractor-plugin',

async loadContent() {
const versions = extractVersions(context.siteDir);
return versions;
},

async contentLoaded({ content, actions }) {
const { createData } = actions;

// Create a JSON file that can be imported
await createData('versions.json', JSON.stringify(content, null, 2));

// Also create a JS module for easier importing
const jsContent = `export default ${JSON.stringify(content, null, 2)};`;
await createData('versions.js', jsContent);

console.log('🔍 Extracted versions:', content);
},

getClientModules() {
return [];
}
};
};
2 changes: 1 addition & 1 deletion scripts/settings/beta-settings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITH
FROM system.settings
WHERE tier = 'Beta'
AND alias_for=''
AND NOT (name LIKE 'vector_search_with_rescoring' OR name LIKE 'vector_search_postfilter_multiplier' OR name LIKE 'vector_search_index_fetch_multiplier')),
AND NOT (name LIKE 'vector_search_with_rescoring' OR name LIKE 'vector_search_postfilter_multiplier' OR name LIKE 'vector_search_index_fetch_multiplier' OR name LIKE 'allow_experimental_vector_similarity_index')),
beta_mergetree_settings AS
(
SELECT
Expand Down
4 changes: 4 additions & 0 deletions src/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ body {
color: white;
}

.footer {
z-index: 100;
}

[data-theme='dark'] .footer {
background-color: var(--click-color-background);
}
Expand Down
1 change: 1 addition & 0 deletions src/css/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
--icon: none;
}


/* Add dark theme */
[data-theme='dark'] {
--ifm-menu-color: #FFFFF;
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useAnchorFix.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export function useAnchorFix() {
if (hash) {
// Wait for content to load, then scroll
setTimeout(() => {
const element = document.querySelector(hash);
// CSS selectors that start with a digit are invalid, so we need to escape them
const escapedHash = hash.replace(/^#(\d)/, '#\\3$1 ');
const element = document.querySelector(escapedHash);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
Expand Down
29 changes: 29 additions & 0 deletions src/hooks/useVersions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useState, useEffect } from 'react';

// Hook to get version information
export function useVersions() {
const [versions, setVersions] = useState({
oss: { version: 'v24.12.1', link: '/docs/whats-new/changelog' },
cloud: { version: 'v25.6', link: '/docs/changelogs/25.6' }
});

useEffect(() => {
// Try to load the generated versions data
const loadVersions = async () => {
try {
// This will work when the plugin generates the data
const versionData = await import('@generated/version-extractor-plugin/default/versions.js');
if (versionData.default) {
setVersions(versionData.default);
}
} catch (error) {
console.warn('Could not load generated versions, using defaults:', error);
// Fallback to defaults already set in useState
}
};

loadVersions();
}, []);

return versions;
}
Loading