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
37 changes: 36 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import starlight from '@astrojs/starlight';
import AutoImport from 'astro-auto-import';
import starlightLinksValidator from 'starlight-links-validator';

// Material themes that have a matching bundled Shiki theme (code blocks follow these 5 only);
// every other theme falls back to github-dark/light by its light/dark type.
Expand Down Expand Up @@ -34,6 +35,7 @@ export default defineConfig({
'./src/components/content/ThemeCard.astro',
'./src/components/content/ThemeCards.astro',
'./src/components/content/ThemeColors.astro',
'./src/components/content/ThemeList.astro',
'./src/components/content/ThemePalette.astro',
'./src/components/content/ThemePalettes.astro',
'./src/components/content/Wallpapers.astro',
Expand Down Expand Up @@ -63,7 +65,40 @@ export default defineConfig({
href: 'https://github.com/mallowigi/material-theme-docs',
},
],
sidebar: [],
sidebar: [
{ label: 'Introduction', slug: 'docs/introduction' },
{ label: 'Getting Started', slug: 'docs/getting-started' },
{
label: 'Configuration',
items: [{ label: 'Accents', slug: 'docs/configuration/accents' }],
},
{
label: 'Reference',
items: [{ label: 'Color Palette', slug: 'docs/reference/color-palette' }],
},
{ label: 'Analytics', slug: 'docs/analytics' },
{ label: 'FAQ/Troubleshooting', slug: 'docs/faq-troubleshooting' },
{ label: 'Other Products', slug: 'docs/other-products' },
{ label: 'Acknowledgements', slug: 'docs/acknowledgements' },
{ label: 'Pricing', slug: 'docs/pricing' },
{ label: 'About Subscription Model', slug: 'docs/about-subscription-model' },
{ label: 'Support Us', slug: 'docs/support-us' },
{ label: 'EULA', slug: 'docs/eula' },
],
plugins: [
starlightLinksValidator({
// Sections not converted yet (configuration, icons, reference, changelog, ...).
exclude: [
'/docs/configuration/**',
'/docs/icons/**',
'/docs/reference/**',
'/docs/changelog/**',
'/docs/whats-new/**',
'/docs/archives/**',
'/docs/development/**',
],
}),
],
components: {
ThemeProvider: './src/components/overrides/ThemeProvider.astro',
ThemeSelect: './src/components/overrides/ThemeSelect.astro',
Expand Down
14 changes: 14 additions & 0 deletions e2e/search.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect, test } from '@playwright/test';

test('searching for a known phrase finds the matching page', async ({ page }) => {
await page.goto('/docs/introduction/');
await page.locator('site-search button').first().click();

const dialog = page.locator('site-search dialog');

await dialog.getByPlaceholder('Search').fill('subscription model');

const result = dialog.locator('a[href*="about-subscription-model"]').first();

await expect(result).toBeVisible();
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"astro": "^7.3.6",
"astro-auto-import": "0.6.0",
"js-yaml": "5.5.0",
"sharp": "^0.35.3"
"sharp": "^0.35.3",
"starlight-links-validator": "0.27.0"
},
"devDependencies": {
"@astrojs/check": "latest",
Expand Down
105 changes: 105 additions & 0 deletions pnpm-lock.yaml

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

Loading
Loading