File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,33 @@ const config: Config = {
150150 createRedirects : ( existingPath : string ) => createRedirectsBase ( existingPath , routeBasePath ) ,
151151 } ,
152152 ] ,
153+
154+ // Sitemap
155+ [
156+ '@docusaurus/plugin-sitemap' ,
157+ {
158+ createSitemapItems : async ( params : any ) => {
159+ const { defaultCreateSitemapItems, ...rest } = params ;
160+ const items = await defaultCreateSitemapItems ( rest ) ;
161+ return items . map ( ( item : any ) => {
162+ // Versioned docs (e.g., /docs/4.5/, /docs/4.4/) - rarely change. could switch to monthly as the dust settles.
163+ if ( / \/ d o c s \/ \d + \. \d + \/ / . test ( item . url ) ) {
164+ return { ...item , changefreq : 'weekly' } ;
165+ }
166+ // Current/latest docs at /docs/ - most frequently updated
167+ if ( item . url . includes ( '/docs/' ) ) {
168+ return { ...item , changefreq : 'daily' } ;
169+ }
170+ // Release notes - fairly frequent updates
171+ if ( item . url . includes ( '/release-notes/' ) ) {
172+ return { ...item , changefreq : 'weekly' } ;
173+ }
174+ // Default for everything else
175+ return { ...item , changefreq : 'weekly' } ;
176+ } ) ;
177+ } ,
178+ } ,
179+ ] ,
153180 ] ,
154181
155182 themes : [
You can’t perform that action at this time.
0 commit comments