Allow multiple handlebars on one line

- As the HyperLisp will put most on the same line

Signed-off-by: Raymonzut <me@raymon.dev>
master
Raymon Zutekouw 2 years ago
parent 24a9a34a73
commit f164d510d8
Signed by: raymon
GPG Key ID: 0E62222846283925
  1. 4
      client/gen.exs

@ -7,8 +7,8 @@ post_feed_template = File.read!("./templates/posts.xml")
# Converting handlebars in template to values
fill_template = fn template, pairs ->
Regex.compile!("{{(.*)}}") |>
Regex.replace(template, fn _, key -> Map.get(pairs, String.to_atom(key)) end)
~r/{{(.*)}}/U
|> Regex.replace(template, fn _, key -> Map.get(pairs, String.to_atom(key)) end)
end
fill_template_pretemplated = fn template -> &fill_template.(template, &1) end

Loading…
Cancel
Save