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 1
1
import { getAll , initialize } from "~/components/Patterns" ;
2
+ import { MIN_ARCHIVE_YEAR } from "~/util/constants" ;
2
3
3
4
function urlLine ( url :string ) {
4
5
return `\t<url><loc>https://www.regex.zone${ url } </loc></url>`
@@ -22,6 +23,17 @@ export async function loader() {
22
23
lines . push ( urlLine ( `/patterns/${ entry . handle } /` ) ) ;
23
24
}
24
25
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
+
25
37
lines . push ( '</urlset>' )
26
38
27
39
return new Response ( lines . join ( '\n' ) , {
You can’t perform that action at this time.
0 commit comments