Update to eex_html 0.2.0, allowing deleting of useless raw() calls

This commit is contained in:
Mikko Ahlroth 2018-11-15 22:00:54 +02:00
parent 73fe7144ab
commit 76344241ff
9 changed files with 40 additions and 39 deletions

View file

@ -1,9 +1,9 @@
<nav class="archives" aria-labelledby="archives-heading">
<h3 id="archives-heading">Archives</h3>
<%= raw(with {max, tags} <- get_tags() do %>
<%= with {max, tags} <- get_tags() do %>
<div class="archives-tags">
<%= raw(for {tag, amount} <- tags do %>
<%= for {tag, amount} <- tags do %>
<a
href="<%= Mebe2.get_conf(:absolute_url) %><%= Mebe2.Web.Views.Utils.get_tag_path(tag) %>"
class="archives-tag"
@ -11,29 +11,29 @@
>
<%= tag %>
</a>
<% end) %>
<% end %>
</div>
<% end) %>
<% end %>
<%= raw(with [_|_] = years <- get_month_archives() do %>
<%= with [_|_] = years <- get_month_archives() do %>
<ul class="archives-year-list">
<%= raw(for {year, months} <- years do %>
<%= for {year, months} <- years do %>
<li>
<a href="<%= Mebe2.Web.Views.Utils.year_path_generator(year).(1) %>">
<%= year %>
</a>
<ul class="archives-month-list">
<%= raw(for month <- months do %>
<%= for month <- months do %>
<li>
<a href="<%= Mebe2.Web.Views.Utils.month_path_generator(year, month).(1) %>">
<%= Mebe2.Web.Views.Utils.format_month(year, month) %>
</a>
</li>
<% end) %>
<% end %>
</ul>
</li>
<% end) %>
<% end %>
</ul>
<% end) %>
<% end %>
</nav>

View file

@ -4,14 +4,14 @@
<meta charset="utf-8" />
<title><%= Mebe2.get_conf(:blog_name) %></title>
<%= raw(if Mebe2.get_conf(:enable_feeds) do %>
<%= if Mebe2.get_conf(:enable_feeds) do %>
<link
rel="alternate"
type="application/rss+xml"
title="RSS feed"
href="<%= Mebe2.get_conf(:absolute_url) %>/feed"
/>
<% end) %>
<% end %>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
@ -20,13 +20,13 @@
<h1><%= Mebe2.get_conf(:blog_name) %></h1>
<nav id="menunav">
<ul>
<%= raw(for menuitem <- Mebe2.Engine.DB.get_menu() do %>
<%= for menuitem <- Mebe2.Engine.DB.get_menu() do %>
<li>
<a href="<%= Mebe2.get_conf(:absolute_url) %><%= menuitem.slug %>">
<%= menuitem.title %>
</a>
</li>
<% end) %>
<% end %>
</ul>
</nav>
</a>

View file

@ -1,4 +1,4 @@
<%= raw(for post <- posts do %>
<%= for post <- posts do %>
<item>
<title>
<![CDATA[<%= raw(post.title) %>]]>
@ -10,11 +10,11 @@
<guid><%= Mebe2.get_conf(:absolute_url) %><%= Mebe2.Web.Views.Utils.get_post_path(post) %></guid>
<description>
<![CDATA[
<%= raw(if Mebe2.get_conf(:show_full_content) do %>
<%= if Mebe2.get_conf(:show_full_content) do %>
<%= raw(post.content) %>
<% else %>
<%= raw(post.short_content) %>
<% end) %>
<% end %>
<a href="<%= Mebe2.get_conf(:absolute_url) %><%= Mebe2.Web.Views.Utils.get_post_path(post) %>">
Read more
@ -23,4 +23,4 @@
</description>
<pubDate><%= format_time(post.datetime) %></pubDate>
</item>
<% end) %>
<% end %>

View file

@ -4,8 +4,8 @@
<%= raw(page.content) %>
<%=
raw(if Mebe2.get_conf(:page_commenting) do
if Mebe2.get_conf(:page_commenting) do
Mebe2.Web.Views.Comments.html(page.title)
end)
end
%>
</article>

View file

@ -1,11 +1,11 @@
<%= raw(if total > ppp() do %>
<%= if total > ppp() do %>
<nav class="pagination">
<%= link(path_generator, page - 1, page == 1, "«") %>
<%= raw(for p <- 1..(total_pages(total)) do %>
<%= for p <- 1..(total_pages(total)) do %>
<%= link(path_generator, p, p == page, (if p == page, do: "[#{p}]", else: "#{p}")) %>
<% end) %>
<% end %>
<%= link(path_generator, page + 1, page >= total_pages(total), "»") %>
</nav>
<% end) %>
<% end %>

View file

@ -1,7 +1,7 @@
<article class="post">
<%= raw(if multi do %>
<%= if multi do %>
<a href="<%= Mebe2.get_conf(:absolute_url) %><%= Mebe2.Web.Views.Utils.get_post_path(post) %>">
<% end) %>
<% end %>
<h1><%= post.title %></h1>
@ -11,29 +11,29 @@
Posted on <%= if post.time_given do format_datetime(post.datetime) else format_date(post.datetime) end %>.
</p>
<p class="post-meta post-meta-tags">
<%= raw(for tag <- post.tags do %>
<%= for tag <- post.tags do %>
<a
href="<%= Mebe2.get_conf(:absolute_url) %><%= Mebe2.Web.Views.Utils.get_tag_path(tag) %>"
class="post-tag"
>
<%= tag %>
</a>
<% end) %>
<% end %>
</p>
<%= raw(if multi && post.has_more do %>
<%= if multi && post.has_more do %>
<%= raw(post.short_content) %>
<% else %>
<%= raw(post.content) %>
<% end) %>
<% end %>
<%= raw(if multi && (post.has_more || Mebe2.get_conf(:force_read_more)) do %>
<%= if multi && (post.has_more || Mebe2.get_conf(:force_read_more)) do %>
<a href="<%= Mebe2.Web.Views.Utils.get_post_path(post) %>">Read more</a>
<% end) %>
<% end %>
<%=
raw(if not multi && Mebe2.get_conf(:disqus_comments) do
if not multi && Mebe2.get_conf(:disqus_comments) do
Mebe2.Web.Views.Comments.html(post.title)
end)
end
%>
</article>

View file

@ -1,5 +1,5 @@
<%= raw(for post <- posts do %>
<%= for post <- posts do %>
<%= Mebe2.Web.Views.Post.html(post, true) %>
<% end) %>
<% end %>
<%= Mebe2.Web.Views.Pagination.html(total, page, path_generator) %>

View file

@ -23,8 +23,9 @@ defmodule Mebe2.MixProject do
defp deps do
[
{:earmark, "~> 1.2.5"},
{:raxx, "~> 0.17.1"},
{:raxx, "~> 0.17.2"},
{:raxx_static, "~> 0.7.0"},
{:eex_html, "~> 0.2.0"},
{:ace, "~> 0.18.0"},
{:calendar, "~> 0.17.4"},
{:ex2ms, "~> 1.5.0"},

View file

@ -6,7 +6,7 @@
"cookie": {:hex, :cookie, "0.1.1", "89438362ee0f0ed400e9f076d617d630f82d682e3fbcf767072a46a6e1ed5781", [:mix], [], "hexpm"},
"distillery": {:hex, :distillery, "2.0.12", "6e78fe042df82610ac3fa50bd7d2d8190ad287d120d3cd1682d83a44e8b34dfb", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.2.6", "b6da42b3831458d3ecc57314dff3051b080b9b2be88c2e5aa41cd642a5b044ed", [:mix], [], "hexpm"},
"eex_html": {:hex, :eex_html, "0.1.1", "df7ad68245068d5fea0dab2a38e5afdc386ec00a5b6445eac6402ed7aa6a2b12", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"eex_html": {:hex, :eex_html, "0.2.0", "7f9da3e8ec2ecda2658a0443c65321e161c7c89897f2011e3d8a70f4f68341cb", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"ex2ms": {:hex, :ex2ms, "1.5.0", "19e27f9212be9a96093fed8cdfbef0a2b56c21237196d26760f11dfcfae58e97", [:mix], [], "hexpm"},
"exsync": {:hex, :exsync, "0.2.3", "a1ac11b4bd3808706003dbe587902101fcc1387d9fc55e8b10972f13a563dd15", [:mix], [{:file_system, "~> 0.2", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm"},
"file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"},
@ -19,7 +19,7 @@
"mime": {:hex, :mime, "1.3.0", "5e8d45a39e95c650900d03f897fbf99ae04f60ab1daa4a34c7a20a5151b7a5fe", [:mix], [], "hexpm"},
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], [], "hexpm"},
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"},
"raxx": {:hex, :raxx, "0.17.1", "86ed70288d46704b156b221ba8c4923200a2d6b163781e9b751398780557745b", [:mix], [{:cookie, "~> 0.1.0", [hex: :cookie, repo: "hexpm", optional: false]}, {:eex_html, "~> 0.1.1", [hex: :eex_html, repo: "hexpm", optional: false]}], "hexpm"},
"raxx": {:hex, :raxx, "0.17.2", "0666b48594a68ad3c92b00feab550bff28be68fc4f3b419abda15d63f61bf8b3", [:mix], [{:cookie, "~> 0.1.0", [hex: :cookie, repo: "hexpm", optional: false]}, {:eex_html, "~> 0.1.1 or ~> 0.2.0", [hex: :eex_html, repo: "hexpm", optional: false]}], "hexpm"},
"raxx_static": {:hex, :raxx_static, "0.7.0", "0ab6f0ce89ab2cc6a7bd6408607b15095509cf4eef6b0ad05fa5f49b0b4b0db1", [:mix], [{:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:raxx, "~> 0.17.0", [hex: :raxx, repo: "hexpm", optional: false]}], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"},
"tzdata": {:hex, :tzdata, "0.5.19", "7962a3997bf06303b7d1772988ede22260f3dae1bf897408ebdac2b4435f4e6a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},