File tree Expand file tree Collapse file tree 5 files changed +20
-1
lines changed
Expand file tree Collapse file tree 5 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ export default defineConfig({
145145 integrations : [
146146 starlight ( {
147147 title : 'Syncpack' ,
148+ routeMiddleware : './src/route-data.ts' ,
148149 social : [
149150 {
150151 icon : 'github' ,
Original file line number Diff line number Diff line change 1414 "private" : true ,
1515 "scripts" : {
1616 "astro" : " astro" ,
17- "build" : " astro check && astro build" ,
17+ "build" : " astro check && astro build && scripts/patch-sitemap.sh " ,
1818 "dev" : " astro dev" ,
1919 "preview" : " astro preview" ,
2020 "start" : " astro dev"
Original file line number Diff line number Diff line change 1+ User-agent: *
2+ Allow: /
3+
4+ Sitemap: https://jamiemason.github.io/syncpack/sitemap.xml
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ rm dist/sitemap-index.xml
4+ mv dist/sitemap-0.xml dist/sitemap.xml
Original file line number Diff line number Diff line change 1+ import { defineRouteMiddleware } from '@astrojs/starlight/route-data' ;
2+
3+ export const onRequest = defineRouteMiddleware ( context => {
4+ context . locals . starlightRoute . head . some ( item => {
5+ if ( item . attrs ?. rel === 'sitemap' ) {
6+ item . attrs . href = '/syncpack/sitemap.xml' ;
7+ return true ;
8+ }
9+ } ) ;
10+ } ) ;
You can’t perform that action at this time.
0 commit comments