Skip to content

Commit f9809d0

Browse files
vishrclaude
andcommitted
feat(docs): new Astro Starlight docs site (Terminal theme)
From-scratch rebuild of the Echo v5 docs on Astro + Starlight with a custom Terminal theme: homepage hero, Ask Echo island, themed asides, pager, tables, code blocks and footer; Echo favicon + logo + OG card; SEO/OG meta; and ~56 content pages (Guide, Middleware, Cookbook) ported and reviewed against echo/v5 v5.0.4 source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 726267d commit f9809d0

78 files changed

Lines changed: 15037 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

site/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
.astro/
4+
.DS_Store

site/astro.config.mjs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { defineConfig } from 'astro/config';
2+
import starlight from '@astrojs/starlight';
3+
4+
// https://astro.build/config
5+
export default defineConfig({
6+
site: 'https://echo.labstack.com',
7+
integrations: [
8+
starlight({
9+
title: 'Echo',
10+
logo: {
11+
light: './src/assets/logo-light.svg',
12+
dark: './src/assets/logo-dark.svg',
13+
replacesTitle: true,
14+
},
15+
customCss: ['./src/styles/terminal.css'],
16+
social: [
17+
{ icon: 'github', label: 'GitHub', href: 'https://github.com/labstack/echo' },
18+
],
19+
editLink: {
20+
baseUrl: 'https://github.com/labstack/echox/edit/master/website/',
21+
},
22+
lastUpdated: true,
23+
// Echo "E" cube mark; .ico kept as legacy fallback, apple-touch-icon added in head.
24+
favicon: '/favicon.svg',
25+
// Keep Starlight's built-in Pagefind ⌘K search; add Ask Echo + DocActions via overrides.
26+
components: {
27+
Footer: './src/components/Footer.astro',
28+
PageTitle: './src/components/PageTitle.astro',
29+
},
30+
head: [
31+
// Dark-first: default new visitors to dark unless they've chosen otherwise.
32+
{
33+
tag: 'script',
34+
content: "if(!localStorage.getItem('starlight-theme')){localStorage.setItem('starlight-theme','dark');document.documentElement.dataset.theme='dark';}",
35+
},
36+
{ tag: 'link', attrs: { rel: 'preconnect', href: 'https://fonts.googleapis.com' } },
37+
{ tag: 'link', attrs: { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: true } },
38+
{
39+
tag: 'link',
40+
attrs: {
41+
rel: 'stylesheet',
42+
href: 'https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Fragment+Mono&display=swap',
43+
},
44+
},
45+
{
46+
tag: 'link',
47+
attrs: {
48+
rel: 'stylesheet',
49+
href: 'https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css',
50+
},
51+
},
52+
// Default social card. Starlight already emits og:title/description/url
53+
// and twitter:card=summary_large_image, but no image — add a site-wide
54+
// default so shares aren't imageless. Absolute URLs are required by
55+
// social scrapers. Per-page overrides can set their own og:image later.
56+
{ tag: 'meta', attrs: { property: 'og:image', content: 'https://echo.labstack.com/og.png' } },
57+
{ tag: 'meta', attrs: { property: 'og:image:width', content: '1200' } },
58+
{ tag: 'meta', attrs: { property: 'og:image:height', content: '630' } },
59+
{ tag: 'meta', attrs: { name: 'twitter:image', content: 'https://echo.labstack.com/og.png' } },
60+
{ tag: 'link', attrs: { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' } },
61+
],
62+
// Autogenerated from the content dirs — new pages appear automatically,
63+
// ordered by each page's `sidebar.order` frontmatter.
64+
sidebar: [
65+
{ label: 'Guide', items: [{ autogenerate: { directory: 'guide' } }] },
66+
{ label: 'Middleware', items: [{ autogenerate: { directory: 'middleware' } }] },
67+
{ label: 'Cookbook', items: [{ autogenerate: { directory: 'cookbook' } }] },
68+
],
69+
// tune the built-in code theme toward our terminal palette
70+
expressiveCode: { themes: ['github-dark', 'github-light'] },
71+
}),
72+
],
73+
});

0 commit comments

Comments
 (0)