aboutsummaryrefslogtreecommitdiff
path: root/lisp/seam-test.el
diff options
context:
space:
mode:
authorSpencer Williams <spnw@plexwave.org>2025-07-11 19:18:15 -0400
committerSpencer Williams <spnw@plexwave.org>2025-07-11 19:25:03 -0400
commit0fb032562ce22e35e1dedc43845bc8c6ca73a423 (patch)
treeb30bff76c62219c66647c3ebc3f489404a444930 /lisp/seam-test.el
parentac468cb3500ac9def50359bb87ba04a7267d1249 (diff)
Add support for custom template vars
Diffstat (limited to 'lisp/seam-test.el')
-rw-r--r--lisp/seam-test.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/seam-test.el b/lisp/seam-test.el
index f361658..5bae015 100644
--- a/lisp/seam-test.el
+++ b/lisp/seam-test.el
@@ -48,6 +48,7 @@
(seam-title-formatter (lambda (title _type _draft-p) title))
(seam-export-template-file nil)
(seam-export-template-string seam-export-default-template-string)
+ (seam-export-template-values nil)
(seam-export-internal-link-class nil)
(seam-export-alist
`((,(file-name-concat seam-test-directory "html")
@@ -561,6 +562,24 @@ accordingly."
(seam-export-all-notes)
(seam-test-list-files)))))
+(ert-deftest seam-test-template-values ()
+ "Test that custom variables can be used in templates, and that
+existing ones can be overridden."
+ (should
+ (equal
+ "Qux\nhello, world\n"
+ (seam-test-with-notes
+ ((seam-export-template-values '(("title" . "Bar")
+ ("greeting" . "hello, world")))
+ (seam-export-template-string "{{title}}\n{{greeting}}")
+ (seam-export-alist
+ `((,(file-name-concat seam-test-directory "html")
+ :types ("public")
+ :root-path "/"
+ :template-values (("title" . "Qux"))))))
+ ((foo "Foo" "public"))
+ (seam-export--file-string "html/foo.html")))))
+
(provide 'seam-test)
;;; seam-test.el ends here