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 7, 2023
1 parent da3f92d commit b15e841
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hugo.scm
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@

(define (write-dish-description dish out)
(h2 "Description" out)
(write-string (description dish) out)
(write-string (replace-wkty (description dish)) out)
(news out)
(let ((wd (word-description dish)))
(if wd
(begin
(news out)
(h3 "Characters" out)
(write-string (word-description dish) out)
(write-string (replace-wkty wd) out)
(newline out)))))

(define (word dish)
Expand Down Expand Up @@ -218,6 +218,9 @@
(define (word-description dish)
(res-value "description" (word dish)))

(define (replace-wkty text)
(regexp-replace-all #/{([^{]*)}/ text "[\\1](https://en.wiktionary.org/wiki/\\1)"))

(define (tags dish)
(res-value "tags" dish))

Expand Down

0 comments on commit b15e841

Please sign in to comment.