Skip to content
Merged
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
2 changes: 2 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -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.',
Expand Down
10 changes: 4 additions & 6 deletions website/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@
<p class="eyebrow">Rust-powered · Free and open source · Apache-2.0</p>
<h1>Clean SQL, every time</h1>
<p class="tagline">A SQL linter and formatter, 50× faster than sqruff.</p>
<p class="lede">
SQLClean spots SQL patterns that look right but quietly misbehave, such as <code>=&nbsp;NULL</code> or a
<code>NOT&nbsp;IN</code> 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.
</p>
<p class="lede">Catch SQL that looks right but quietly misbehaves, apply safe fixes, and format every file one way.</p>
<div class="actions">
<div class="install">
<span><span class="prompt">$</span> pip install sqlclean</span>
Expand Down Expand Up @@ -468,7 +464,9 @@ <h2>Make clean SQL the default</h2>
<nav class="sqlstack-tools" aria-label="SQLStack tools">
<a href="https://sqlbuild.com">SQLBuild</a>
<a href="/">SQLClean</a>
<a href="https://docs.streambuild.dev">SQLTide</a>
<a href="https://sqlbabel.io">SQLBabel</a>
<a href="https://sqlload.io">SQLLoad</a>
<a href="https://sqltide.io">SQLTide</a>
<a href="https://fensu.io">Fensu</a>
</nav>
</div>
Expand Down
4 changes: 3 additions & 1 deletion website/src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import DefaultFooter from '@astrojs/starlight/components/Footer.astro';
<nav class="sqlstack-tools" aria-label="SQLStack tools">
<a href="https://sqlbuild.com">SQLBuild</a>
<a href="/">SQLClean</a>
<a href="https://docs.streambuild.dev">SQLTide</a>
<a href="https://sqlbabel.io">SQLBabel</a>
<a href="https://sqlload.io">SQLLoad</a>
<a href="https://sqltide.io">SQLTide</a>
<a href="https://fensu.io">Fensu</a>
</nav>
</div>
Expand Down
Loading