~zainab/blog

blog/src/sitemap.rkt -rw-r--r-- 463 bytes
d9e5070ezainab-ali Add question aside 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#lang racket

(require pollen/pagetree)

(define baseurl "https://blog.kebab-ca.se")

(define (sitemap-url page)
  `(url
    (loc ,(format "~a/~a" baseurl page))
    (changefreq "daily")))

(define sitemap
  (let ([base `(url (loc ,baseurl) (changefreq "daily"))]
        [pages (pagetree->list (get-pagetree "index.ptree"))])
    `(urlset ([xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"])
      ,base
      ,@(map sitemap-url pages))))

(provide sitemap)