~michalr/blog2gmi

9510b8fda60e790558bba390407d928db890b1ae — MichaƂ Rudowicz 3 years ago 5aa810f main
Fixed https://todo.sr.ht/~michalr/crystal-stuff/2
1 files changed, 2 insertions(+), 1 deletions(-)

M src/main.cr
M src/main.cr => src/main.cr +2 -1
@@ 5,6 5,7 @@ require "./templates"
require "map_parallel"
require "option_parser"
require "crustache"
require "html"

posts_dir = "."
output_dir = nil


@@ 84,6 85,6 @@ end
entry_template = Crustache.parse(entry_tpl())
model["entries"].map_parallel do |entry|
  File.open(Path.new(output_dir_s, entry["url"].as(String)), "w") do |file|
    file.puts(Crustache.render(entry_template, entry))
    file.puts(HTML.unescape(Crustache.render(entry_template, entry)))
  end
end