From 192bc23cc952c9c05b6da076268bc403dd2230c8 Mon Sep 17 00:00:00 2001 From: Kevin Longe <273747162+kvlonge@users.noreply.github.com> Date: Sun, 29 Nov 2026 09:23:43 +0000 Subject: [PATCH] docs(website): shorter homepage hero The hero's supporting paragraph is one short line. The SQLStack footer, on the homepage and in the docs, lists SQLBabel and SQLLoad and links SQLTide to sqltide.io. The build versions the homepage's styles.css link by its content, so a changed stylesheet is not served from a stale cache. --- website/README.md | 2 ++ website/astro.config.mjs | 18 ++++++++++++++++++ website/public/index.html | 10 ++++------ website/src/components/Footer.astro | 4 +++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/website/README.md b/website/README.md index 849cf25..d35d53c 100644 --- a/website/README.md +++ b/website/README.md @@ -5,6 +5,8 @@ The SQLClean website: the homepage at `/` and the documentation at `/docs/`, bui - `public/index.html` and `public/styles.css`: the homepage, plain static HTML and CSS. Its terminal examples are real `sqlclean` output from small example projects, trimmed to the relevant lines. + The build versions the homepage's `styles.css` link by its content, so a changed stylesheet is + never served from a stale cache. - `src/content/docs/docs/`: the documentation pages (MDX). `src/sidebar.json` holds the sidebar and `src/navigation.mjs` the redirects. `STYLE.md` is the style guide for these pages. - `src/components/`: the page layout, header and page title, replacing Starlight's defaults. diff --git a/website/astro.config.mjs b/website/astro.config.mjs index a451579..54a7409 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -1,13 +1,31 @@ +import { createHash } from 'node:crypto'; +import { readFile, writeFile } from 'node:fs/promises'; import { defineConfig } from 'astro/config'; import starlight from '@astrojs/starlight'; import starlightLlmsTxt from 'starlight-llms-txt'; import { sqlcleanDark, sqlcleanLight } from './src/code-themes.mjs'; import { redirects, sidebar } from './src/navigation.mjs'; +// The homepage links public/styles.css, which keeps its name; a version from its content makes +// browsers fetch it again whenever it changes. +const versionHomepageStyles = { + name: 'version-homepage-styles', + hooks: { + 'astro:build:done': async ({ dir }) => { + const version = createHash('sha256').update(await readFile(new URL('styles.css', dir))).digest('hex').slice(0, 8); + const page = new URL('index.html', dir); + const html = await readFile(page, 'utf8'); + if (!html.includes('href="styles.css"')) throw new Error('index.html no longer links href="styles.css"'); + await writeFile(page, html.replace('href="styles.css"', `href="/styles.css?v=${version}"`)); + }, + }, +}; + export default defineConfig({ site: 'https://sqlclean.io', redirects, integrations: [ + versionHomepageStyles, starlight({ title: 'SQLClean', description: 'Fast SQL linting, safe fixes and one canonical format.', diff --git a/website/public/index.html b/website/public/index.html index 77d9695..e10fdb0 100644 --- a/website/public/index.html +++ b/website/public/index.html @@ -63,11 +63,7 @@

Rust-powered · Free and open source · Apache-2.0

Clean SQL, every time

A SQL linter and formatter, 50× faster than sqruff.

-

- SQLClean spots SQL patterns that look right but quietly misbehave, such as = NULL or a - NOT IN list with a NULL, applies safe fixes, and formats every file one way. - Custom Rules are plain Python functions, backed by a Rust API that keeps them fast. -

+

Catch SQL that looks right but quietly misbehaves, apply safe fixes, and format every file one way.

$ pip install sqlclean @@ -468,7 +464,9 @@

Make clean SQL the default

diff --git a/website/src/components/Footer.astro b/website/src/components/Footer.astro index ba8803d..6591d52 100644 --- a/website/src/components/Footer.astro +++ b/website/src/components/Footer.astro @@ -12,7 +12,9 @@ import DefaultFooter from '@astrojs/starlight/components/Footer.astro';