Allow multiple handlebars on one line

- As the HyperLisp will put most on the same line

Signed-off-by: Raymonzut <me@raymon.dev>
This commit is contained in:
2022-03-18 22:49:43 +01:00
parent 24a9a34a73
commit f164d510d8
+2 -2
View File
@@ -7,8 +7,8 @@ post_feed_template = File.read!("./templates/posts.xml")
# Converting handlebars in template to values # Converting handlebars in template to values
fill_template = fn template, pairs -> fill_template = fn template, pairs ->
Regex.compile!("{{(.*)}}") |> ~r/{{(.*)}}/U
Regex.replace(template, fn _, key -> Map.get(pairs, String.to_atom(key)) end) |> Regex.replace(template, fn _, key -> Map.get(pairs, String.to_atom(key)) end)
end end
fill_template_pretemplated = fn template -> &fill_template.(template, &1) end fill_template_pretemplated = fn template -> &fill_template.(template, &1) end