Skip to content

Commit

Permalink
Add sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
titouanmathis committed Oct 23, 2023
1 parent bc15cc4 commit 69835fb
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions packages/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'node:fs';
import { basename, dirname, resolve, join } from 'node:path';
import { defineConfig } from 'vitepress';
import { withLeadingSlash, withTrailingSlash } from '@studiometa/js-toolkit/utils';
import { withLeadingSlash, withTrailingSlash, withLeadingCharacters } from '@studiometa/js-toolkit/utils';
import glob from 'fast-glob';

const pkg = JSON.parse(
Expand All @@ -11,7 +11,7 @@ const pkg = JSON.parse(
export default defineConfig({
lang: 'en-US',
title: '@studiometa/ui',
description: 'A set of opiniated, unstyled and accessible components',
description: 'A feature-rich library of primitives and components built with ♥️ by Studio Meta',
lastUpdated: true,
base: '/-/',
outDir: './.symfony/public/-',
Expand All @@ -23,6 +23,23 @@ export default defineConfig({
],
['link', { rel: 'icon', type: 'image/x-icon', href: '/-/logo.png' }],
],
sitemap: {
hostname: 'https://ui.studiometa.dev/',
transformItems(items) {
// Add the playground
items.push({
url: 'play',
changefreq: 'monthly',
priority: 0.8
});

// Add base URL
return items.map(item => ({
...item,
url: withLeadingCharacters(item.url, '-/')
}));
}
},
themeConfig: {
version: pkg.version,
repo: 'studiometa/ui',
Expand Down

0 comments on commit 69835fb

Please sign in to comment.