File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11import { getAll , initialize } from "~/components/Patterns" ;
2+ import { MIN_ARCHIVE_YEAR } from "~/util/constants" ;
23
34function urlLine ( url :string ) {
45 return `\t<url><loc>https://www.regex.zone${ url } </loc></url>`
@@ -22,6 +23,17 @@ export async function loader() {
2223 lines . push ( urlLine ( `/patterns/${ entry . handle } /` ) ) ;
2324 }
2425
26+ lines . push ( urlLine ( '/links/' ) ) ;
27+ lines . push ( urlLine ( '/links/tags.html' ) ) ;
28+ lines . push ( urlLine ( '/links/archive/' ) ) ;
29+ const currentYear = new Date ( ) . getFullYear ( ) ;
30+ for ( let year = MIN_ARCHIVE_YEAR ; year <= currentYear ; year ++ ) {
31+ if ( year == 2010 ) {
32+ continue ; // hack since no links in 2010
33+ }
34+ lines . push ( urlLine ( `/links/archive/${ year } /` ) ) ;
35+ }
36+
2537 lines . push ( '</urlset>' )
2638
2739 return new Response ( lines . join ( '\n' ) , {
You can’t perform that action at this time.
0 commit comments