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 c062693 commit b182316
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions hugo.scm
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,14 @@
(define (country-regions country)
(res-value "regions" country))

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

(define (region-places region)
(res-value "places" region))

(define (place-title place)
(res-value "title" place))

(define (read-places)
(let ((us (read-json "assets/json/place/us.json")))
Expand All @@ -297,12 +303,20 @@
(write-region region out)))))

(define (write-region region out)
(write-region-header region out))
(write-region-header region out)
(for-each (lambda (place)
(write-region-place place out))
(region-places region)))

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

(define (write-region-place place out)
(print place)
(h2 (place-title place) out)
(news out))

0 comments on commit b182316

Please sign in to comment.