- move pre-gen files out of public/
master
Raymonzut 4 years ago
parent 403fc9d5cb
commit eff86a1f3e
No known key found for this signature in database
GPG Key ID: 1E9BCC39EDD1DD53
  1. 1
      client/.gitignore
  2. 6
      client/gen.ex
  3. 0
      client/posts/.gitkeep
  4. 1
      client/public/.gitignore
  5. 0
      client/templates/post_index_page.html
  6. 0
      client/templates/post_item.xml
  7. 0
      client/templates/post_single_page.html
  8. 0
      client/templates/posts.xml

1
client/.gitignore vendored

@ -0,0 +1 @@
posts/*

@ -48,13 +48,13 @@ index_file = post_contents
|> (fn v -> %{index: v} end).() |> (fn v -> %{index: v} end).()
|> fill_template_pretemplated.(index_template).() |> fill_template_pretemplated.(index_template).()
File.open!("./gen/index.html", [:write]) File.open!("./public/gen/index.html", [:write])
|> IO.binwrite(index_file) |> IO.binwrite(index_file)
|> File.close() |> File.close()
post_contents post_contents
|> Enum.each(fn post -> |> Enum.each(fn post ->
File.open!("./gen/" <> Map.get(post, :id) <> ".html", [:write]) File.open!("./public/gen/" <> Map.get(post, :id) <> ".html", [:write])
|> IO.binwrite(fill_template.(post_template, post)) |> IO.binwrite(fill_template.(post_template, post))
|> File.close() |> File.close()
end) end)
@ -67,6 +67,6 @@ post_feed = post_contents
|> (fn v -> %{items: v} end).() |> (fn v -> %{items: v} end).()
|> fill_template_pretemplated.(post_feed_template).() |> fill_template_pretemplated.(post_feed_template).()
File.open!("./gen/rss.xml", [:write]) File.open!("./public/gen/rss.xml", [:write])
|> IO.binwrite(post_feed) |> IO.binwrite(post_feed)
|> File.close() |> File.close()

@ -1,2 +1 @@
posts/*
gen/* gen/*

Loading…
Cancel
Save