File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ defmodule EncodingBits.Helpers do
1414 end
1515 end
1616
17+ defmacro remove_title ( content ) do
18+ quote do
19+ Regex . replace ( % r / < h1 > ( . * ?) < \/ h1 > /g , unquote ( content ) , "" )
20+ end
21+ end
22+
1723 def title ( content ) when is_bitstring ( content ) do
1824 " - #{ content } "
1925 end
Original file line number Diff line number Diff line change 1515 <updated ><%= datetime(article) %> </updated >
1616 <link type =" text/html" rel =" alternate" href =" http://encodingbits.com/<%= article[:slug] %>" />
1717 <title ><%= article[: title] %> </title >
18- <content type =" html" ><%= h(article[: body]) %> </content >
18+ <content type =" html" ><%= h(remove_title( article[: body]) ) %> </content >
1919 <author >
2020 <name >Mike Pack</name >
2121 </author >
You can’t perform that action at this time.
0 commit comments