Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Update hugo.scm
Browse files Browse the repository at this point in the history
  • Loading branch information
technicat committed Aug 21, 2023
1 parent 254940b commit c062693
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions hugo.scm
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
(define (country-regions country)
(res-value "regions" country))

(define (state-name state)
(define (region-name state)
(res-value "name" state))

(define (read-places)
Expand All @@ -287,19 +287,22 @@
(country-regions us))))

(define (write-places places)
(for-each (lambda (state)
(write-state-file state))
(for-each (lambda (region)
(write-region-file region))
places))

(define (write-state-file state)
(let ((file #"../hugodimsum/content/places/~(state-name state).md"))
(define (write-region-file region)
(let ((file #"../hugodimsum/content/places/~(region-name region).md"))
(call-with-output-file file (lambda (out)
(write-state-header state out)))))
(write-region region out)))))

(define (write-state-header state out)
(define (write-region region out)
(write-region-header region out))

(define (write-region-header region out)
(hugo-header-line out)
(newline out)
(hugo-title (state-name state) out)
(hugo-title (region-name region) out)
(hugo-date-none out)
(hugo-header-line out)
(news out))

0 comments on commit c062693

Please sign in to comment.