Migrate website to Starlight with full-text resource search (#883)

* Add search functionality to Learning Hub index page

Add a client-side search bar that filters articles by title, description,
and tags. Sections with no matching results are hidden automatically.
Uses the existing .search-bar CSS pattern from the cookbook page.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: remove deprecated layouts, theme script, and learning-hub config

Phase 5 cleanup of Starlight migration:
- Delete BaseLayout.astro (replaced by StarlightPage)
- Delete ArticleLayout.astro (replaced by Starlight docs rendering)
- Delete theme.ts (Starlight has built-in theme toggle)
- Delete src/config/learning-hub.ts (sidebar order now in astro.config.mjs)
- Replace learning-hub glob collection with Starlight docs collection in content.config.ts
- Keep search.ts (still used by homepage and all resource page scripts)

Build verified: 23 pages, no errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Migrate website to Starlight with full-text resource search

- Replace bespoke Astro layouts with Starlight integration
  - Homepage and resource pages use StarlightPage wrapper
  - Learning Hub articles rendered via Starlight docs collection
  - Starlight provides search, theme toggle, sidebar, ToC, a11y

- Add custom Pagefind integration for resource search
  - All 614 agents/skills/instructions/hooks/workflows/plugins
    indexed as custom records with deep-link URLs
  - Type filter pills (horizontal pill toggles) above results
  - Search results link directly to resource modals via #file= hash

- Move global.css to src/styles/ for Vite processing
  - Scope CSS reset to #main-content to avoid Starlight conflicts
  - Full-width page gradient via body:has(#main-content)
  - Light/dark theme support with Starlight gray scale inversion

- Delete old layouts (BaseLayout, ArticleLayout), theme.ts, config

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback

- Fix pagefind-resources.ts header comment (pagefind:true not false)
- Remove unused base variable in cookbook/index.astro
- Replace hardcoded /awesome-copilot/ paths with relative links in index.md
- Delete stale public/styles/global.css (source of truth is src/styles/)
- Replace fragile getBasePath() with Astro config base in pagefind integration
- Document pagefind:true reasoning in astro.config.mjs
- Use proper visually-hidden pattern + :focus-visible ring for filter pills
- Remove dead header/nav/theme CSS from global.css (~160 lines)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Aaron Powell
2026-03-05 21:50:44 +11:00
committed by GitHub
parent 8fedf95507
commit 40fd1a6c72
50 changed files with 1891 additions and 888 deletions

View File

@@ -1,51 +1,35 @@
---
import BaseLayout from '../../../layouts/BaseLayout.astro';
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
import Modal from '../../../components/Modal.astro';
const base = import.meta.env.BASE_URL;
---
<BaseLayout title="Cookbook" description="Code samples, recipes, and examples for building with GitHub Copilot" activeNav="learning-hub">
<main id="main-content">
<div class="page-header">
<div class="container">
<nav class="breadcrumb" aria-label="Breadcrumb">
<a href={`${base}learning-hub/`}>← Learning Hub</a>
</nav>
<h1>🍳 Cookbook</h1>
<p>Code samples, recipes, and examples for building with GitHub Copilot tools</p>
</div>
<StarlightPage frontmatter={{ title: 'Cookbook', description: 'Code samples, recipes, and examples for building with GitHub Copilot' }}>
<div class="cookbook-page">
<div class="search-bar">
<label for="search-input" class="sr-only">Search recipes</label>
<input type="text" id="search-input" placeholder="Search recipes..." autocomplete="off">
</div>
<div class="page-content">
<div class="container">
<div class="search-bar">
<label for="search-input" class="sr-only">Search recipes</label>
<input type="text" id="search-input" placeholder="Search recipes..." autocomplete="off">
</div>
<div class="filters-bar" id="filters-bar">
<div class="filter-group">
<label for="filter-language">Language:</label>
<select id="filter-language" aria-label="Filter by language">
<option value="">All Languages</option>
</select>
</div>
<div class="filter-group">
<label for="filter-tag">Tags:</label>
<select id="filter-tag" multiple aria-label="Filter by tags"></select>
</div>
<button id="clear-filters" class="btn btn-secondary btn-small">Clear Filters</button>
</div>
<div class="results-count" id="results-count" aria-live="polite"></div>
<div id="samples-list" role="list">
<div class="loading" aria-live="polite">Loading samples...</div>
</div>
<div class="filters-bar" id="filters-bar">
<div class="filter-group">
<label for="filter-language">Language:</label>
<select id="filter-language" aria-label="Filter by language">
<option value="">All Languages</option>
</select>
</div>
<div class="filter-group">
<label for="filter-tag">Tags:</label>
<select id="filter-tag" multiple aria-label="Filter by tags"></select>
</div>
<button id="clear-filters" class="btn btn-secondary btn-small">Clear Filters</button>
</div>
</main>
<div class="results-count" id="results-count" aria-live="polite"></div>
<div id="samples-list" role="list">
<div class="loading" aria-live="polite">Loading samples...</div>
</div>
</div>
<Modal />
@@ -281,4 +265,4 @@ const base = import.meta.env.BASE_URL;
<script>
import '../../../scripts/pages/samples';
</script>
</BaseLayout>
</StarlightPage>