From 47377e62c6d71f965a693722d43a6e864dc9b2cb Mon Sep 17 00:00:00 2001 From: Paul David Date: Wed, 9 Jan 2019 23:06:30 +1100 Subject: [PATCH 1/2] Don't lose listiness after unquoting When `v` here contains a list (as opposed to a simple datum like a string) it would, upon unquoting the entire expression, go from something like `'(a b)` to `(a b)`. This would then cause the error that `a` is undefined or not a function or whatever, because the `let` form tries to evaluate it. Adding this quote in between quasi quote-and-unquoting seems to fix the issue. --- frog/private/template.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frog/private/template.rkt b/frog/private/template.rkt index 872263b4..2b3d278b 100644 --- a/frog/private/template.rkt +++ b/frog/private/template.rkt @@ -63,6 +63,6 @@ ;; dict. `include/text` effectively evaluates the template as if ;; it were written in #lang scribble/text. (eval `(let (,@(for/list ([(k v) (in-dict dict)]) - (list k v))) + (list k `',v))) (include-template ,filename)) (current-namespace)))) From 9c3cd4dba478fb17576cbfae001e45da4c40e2a7 Mon Sep 17 00:00:00 2001 From: Paul David Date: Wed, 9 Jan 2019 23:08:20 +1100 Subject: [PATCH 2/2] Pass the tags in native list format, too. Since, for now, i'm trying to set arbitrary post metadata using tags like `Frubbles:88` or `City:Philadelphia`, it makes my life easier to have access to the raw tag list, instead of the one that's been dragged through `tags->xexpr` and `xexpr->string`. --- frog/private/posts.rkt | 1 + 1 file changed, 1 insertion(+) diff --git a/frog/private/posts.rkt b/frog/private/posts.rkt index f488a55d..735af2e8 100644 --- a/frog/private/posts.rkt +++ b/frog/private/posts.rkt @@ -266,6 +266,7 @@ 'date-struct (date->date-struct date) 'date (~> date date->xexpr xexpr->string) 'tags (~> tags tags->xexpr xexpr->string) + 'tag-list tags 'authors (~> tags author-tags->xexpr xexpr->string) 'date+tags (~> (date+tags->xexpr date tags) xexpr->string) 'content body