File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 11import sm from "sitemap" ;
2- import OperationConfig from "../../core/config/OperationConfig.json" assert { type : "json "} ;
3-
2+ import OperationConfig from "../../core/config/OperationConfig.json" assert { type : "json " } ;
43
54/**
65 * Generates an XML sitemap for all CyberChef operations and a number of recipes.
@@ -10,25 +9,25 @@ import OperationConfig from "../../core/config/OperationConfig.json" assert {typ
109 * @license Apache-2.0
1110 */
1211
13- const smStream = new sm . SitemapStream ( {
14- hostname : "https://gchq.github.io/CyberChef" ,
15- } ) ;
12+ const baseUrl = "https://gchq.github.io/CyberChef/" ;
13+
14+ const smStream = new sm . SitemapStream ( { } ) ;
1615
1716smStream . write ( {
18- url : "/" ,
17+ url : baseUrl ,
1918 changefreq : "weekly" ,
20- priority : 1.0
19+ priority : 1.0 ,
2120} ) ;
2221
2322for ( const op in OperationConfig ) {
2423 smStream . write ( {
25- url : `/ ?op=${ encodeURIComponent ( op ) } ` ,
24+ url : `${ baseUrl } ?op=${ encodeURIComponent ( op ) } ` ,
2625 changeFreq : "yearly" ,
27- priority : 0.5
26+ priority : 0.5 ,
2827 } ) ;
2928}
3029smStream . end ( ) ;
3130
3231sm . streamToPromise ( smStream ) . then (
33- buffer => console . log ( buffer . toString ( ) ) // eslint-disable-line no-console
32+ ( buffer ) => console . log ( buffer . toString ( ) ) , // eslint-disable-line no-console
3433) ;
You can’t perform that action at this time.
0 commit comments