From eff86a1f3ebf60cb9bd216e08d8d150a00f3b4a7 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Sat, 7 Nov 2020 11:31:10 +0100 Subject: [PATCH] Fix #12 - move pre-gen files out of public/ --- client/.gitignore | 1 + client/{public => }/gen.ex | 6 +++--- client/{public => }/posts/.gitkeep | 0 client/public/.gitignore | 1 - client/{public => }/templates/post_index_page.html | 0 client/{public => }/templates/post_item.xml | 0 client/{public => }/templates/post_single_page.html | 0 client/{public => }/templates/posts.xml | 0 8 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 client/.gitignore rename client/{public => }/gen.ex (94%) rename client/{public => }/posts/.gitkeep (100%) rename client/{public => }/templates/post_index_page.html (100%) rename client/{public => }/templates/post_item.xml (100%) rename client/{public => }/templates/post_single_page.html (100%) rename client/{public => }/templates/posts.xml (100%) diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..03ddbf1 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1 @@ +posts/* diff --git a/client/public/gen.ex b/client/gen.ex similarity index 94% rename from client/public/gen.ex rename to client/gen.ex index 5d72c1b..0a853f6 100644 --- a/client/public/gen.ex +++ b/client/gen.ex @@ -48,13 +48,13 @@ index_file = post_contents |> (fn v -> %{index: v} end).() |> fill_template_pretemplated.(index_template).() -File.open!("./gen/index.html", [:write]) +File.open!("./public/gen/index.html", [:write]) |> IO.binwrite(index_file) |> File.close() post_contents |> 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)) |> File.close() end) @@ -67,6 +67,6 @@ post_feed = post_contents |> (fn v -> %{items: v} end).() |> fill_template_pretemplated.(post_feed_template).() -File.open!("./gen/rss.xml", [:write]) +File.open!("./public/gen/rss.xml", [:write]) |> IO.binwrite(post_feed) |> File.close() diff --git a/client/public/posts/.gitkeep b/client/posts/.gitkeep similarity index 100% rename from client/public/posts/.gitkeep rename to client/posts/.gitkeep diff --git a/client/public/.gitignore b/client/public/.gitignore index 690991b..7b86b0c 100644 --- a/client/public/.gitignore +++ b/client/public/.gitignore @@ -1,2 +1 @@ -posts/* gen/* diff --git a/client/public/templates/post_index_page.html b/client/templates/post_index_page.html similarity index 100% rename from client/public/templates/post_index_page.html rename to client/templates/post_index_page.html diff --git a/client/public/templates/post_item.xml b/client/templates/post_item.xml similarity index 100% rename from client/public/templates/post_item.xml rename to client/templates/post_item.xml diff --git a/client/public/templates/post_single_page.html b/client/templates/post_single_page.html similarity index 100% rename from client/public/templates/post_single_page.html rename to client/templates/post_single_page.html diff --git a/client/public/templates/posts.xml b/client/templates/posts.xml similarity index 100% rename from client/public/templates/posts.xml rename to client/templates/posts.xml