Arbitrary metadata, paving the way, Pt. I #242
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The context for this PR is the discussion in #214. To be clear, i don't really expect this PR to be accepted, but i would like to use it as a way to gather input on what i'm trying to do. Also, apologies for my crude hacking, my Racket is rusty and probably needs restringing.
I spent quite a while staring at the Frog code, in the hope that i could help myself. I basically want a reliable way to set a variable inside my blog post (whether it be Markdown or Scribble) and refer to it in
page-template.html
. I found that i could kinda sorta abuse tags likeFoo:3
and regex them out in the template (at least i could use unmodified Frog), but that was really not helping me sleep at night. So i thought i'd try to allow either arbitrary fields infrog/frog/private/posts.rkt
Line 137 in 08fa3db
meta-data
's return type.. everywhere) or alternatively take the path of least resistance and make the Racket list with tags available in the template by adding it to the dictionary herefrog/frog/private/posts.rkt
Line 261 in 08fa3db
frog/frog/private/template.rkt
Line 58 in 2bc070a
Anyway, modifying that hash turned out not to work, and after struggling on a few separate occasions and finally manually expanding the macro magic which
let
s the hash into the page's namespace, i saw that list values were getting turned from'(happy list)
into(happy list)
, which of course made Racket sad in the context of:My commit basically puts back the magical
quote
to turn the value ofboo
back into a list. Is there a better way to do this? As best as i can tell i haven't broken anything by doing this.