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
28 changes: 28 additions & 0 deletions docs/.astro/collections/blog.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@
"date": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"author": {
"type": "string"
},
"updatedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "string",
"format": "date"
},
{
"type": "integer",
"format": "unix-time"
}
]
},
"status": {
"type": "string"
},
"$schema": {
"type": "string"
}
Expand Down
28 changes: 28 additions & 0 deletions docs/.astro/collections/docs.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@
"order": {
"type": "number"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"author": {
"type": "string"
},
"updatedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "string",
"format": "date"
},
{
"type": "integer",
"format": "unix-time"
}
]
},
"status": {
"type": "string"
},
"$schema": {
"type": "string"
}
Expand Down
2 changes: 2 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { defineConfig } from 'astro/config';
import tailwindcss from '@tailwindcss/vite';
import sitemap from '@astrojs/sitemap';
import { remarkRewriteLinks } from './src/plugins/remark-rewrite-links.mjs';
import { rehypePagefindAttrs } from './src/plugins/rehype-pagefind-attrs.mjs';

export default defineConfig({
site: 'https://bradygaster.github.io',
base: '/squad/',
integrations: [sitemap()],
vite: {
plugins: [tailwindcss()],
},
Expand Down
158 changes: 158 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"test:e2e": "npx playwright test"
},
"dependencies": {
"@astrojs/rss": "^4.0.17",
"@astrojs/sitemap": "^3.7.1",
"@tailwindcss/vite": "^4.1.0",
"astro": "^5.7.0",
"sharp": "^0.34.5",
Expand Down
4 changes: 4 additions & 0 deletions docs/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /
Sitemap: https://squad.dev/sitemap-index.xml

46 changes: 46 additions & 0 deletions docs/src/components/TableOfContents.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
// Client-side Table of Contents — reads h2/h3 from the article after render
---

<nav id="toc" class="toc sticky top-8 text-sm" aria-label="On this page" data-pagefind-ignore>
<p class="font-semibold text-surface-700 dark:text-surface-300 mb-2 text-xs uppercase tracking-wide">On this page</p>
<ul id="toc-list" class="space-y-1 text-surface-500 dark:text-surface-400">
<!-- Populated by client script -->
</ul>
</nav>

<script is:inline>
function buildToc() {
const article = document.querySelector('article[data-pagefind-body]');
const list = document.getElementById('toc-list');
if (!article || !list) return;

const headings = Array.from(article.querySelectorAll('h2, h3'));
if (headings.length === 0) {
document.getElementById('toc')?.classList.add('hidden');
return;
}

list.innerHTML = '';
headings.forEach((h) => {
if (!h.id) {
h.id = h.textContent
?.toLowerCase()
.replace(/[^\w\s-]/g, '')
.replace(/\s+/g, '-') || '';
}
const li = document.createElement('li');
const a = document.createElement('a');
a.href = '#' + h.id;
a.textContent = h.textContent || '';
a.className = h.tagName === 'H3'
? 'block pl-3 py-0.5 hover:text-squad-600 dark:hover:text-squad-400 transition-colors'
: 'block py-0.5 hover:text-squad-600 dark:hover:text-squad-400 transition-colors font-medium';
li.appendChild(a);
list.appendChild(li);
});
}

document.addEventListener('astro:page-load', buildToc);
buildToc();
</script>
8 changes: 8 additions & 0 deletions docs/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const docs = defineCollection({
title: z.string().optional(),
description: z.string().optional(),
order: z.number().optional(),
tags: z.array(z.string()).optional(),
author: z.string().optional(),
updatedAt: z.coerce.date().optional(),
status: z.string().optional(),
}),
});

Expand All @@ -16,6 +20,10 @@ const blog = defineCollection({
title: z.string().optional(),
description: z.string().optional(),
date: z.coerce.string().optional(),
tags: z.array(z.string()).optional(),
author: z.string().optional(),
updatedAt: z.coerce.date().optional(),
status: z.string().optional(),
}),
});

Expand Down
Loading
Loading