summaryrefslogtreecommitdiff
path: root/tmpl
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-09 16:45:53 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-09 16:45:53 -0500
commit5022d1a0df1534b1cbec1cbee23568f201ea1cc6 (patch)
tree559db39e2be5933c621a02c3f9874641b7f1a70c /tmpl
parentf63a89bb8c494ea6b049285ec7c904d6d6136a88 (diff)
Implement actual file generation, go through fixing things.
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/index.atom.erb10
-rw-r--r--tmpl/page.atom.erb19
-rw-r--r--tmpl/page.html.erb2
3 files changed, 16 insertions, 15 deletions
diff --git a/tmpl/index.atom.erb b/tmpl/index.atom.erb
index 54e4b72..8719d05 100644
--- a/tmpl/index.atom.erb
+++ b/tmpl/index.atom.erb
@@ -1,12 +1,12 @@
<feed xmlns="http://www.w3.org/2005/Atom">
- <title>AndrewDM.me <%= @title %></title>
+ <title><%= atom_title %></title>
<link rel="self" type="application/atom+xml" href="./index.atom"/>
<link rel="alternate" type="text/html" href="./"/>
<link rel="alternate" type="text/markdown" href="./index.md"/>
- <updated><%= @pages.map{|p|p.updated}.sort.last.rfc3339 %></updated>
- <author><%= Person.new("Andrew Murrell").atom %></author>
- <id><%= $url %></id>
+ <updated><%= index_pages_leaves.map{|p|p.atom_updated}.sort.last.to_datetime.rfc3339 %></updated>
+ <author><%= Person.new(Config::get.default_author).atom %></author>
+ <id><%= url %></id>
- <% @pages.sort_by{|p| p.updated}.reverse.each do |page| %><%=@page.atom %><% end %>
+ <% index_pages_leaves.sort_by{|p|p.atom_updated}.reverse.each do |page| %><%= page.atom %><% end %>
</feed>
diff --git a/tmpl/page.atom.erb b/tmpl/page.atom.erb
index ea37ea5..d690974 100644
--- a/tmpl/page.atom.erb
+++ b/tmpl/page.atom.erb
@@ -1,10 +1,11 @@
-<entry xmlns="http://www.w3.org/2005/Atom">
- <link rel="alternate" type="text/html" href="<%= page.url %>"/>
- <id><%= page.url %></id>
- <updated><%= page.updated.rfc3339 %></updated>
- <published><%= page.published.rfc3339 %></published>
- <title><%= page.title %></title>
- <author><%= page.author.atom %></author>
- <% if page.content %><content type="html"><%= html_escape(page.content) %></content><% end %>
- <% if page.rights %><rights type="html"><%= html_escape(page.rights) %></rights><% end %>
+<% require 'siteutil' %><entry xmlns="http://www.w3.org/2005/Atom">
+ <link rel="alternate" type="text/html" href="<%= url %>"/>
+ <id><%= url %></id>
+ <updated><%= atom_updated.to_datetime.rfc3339 %></updated>
+ <published><%= atom_published.to_datetime.rfc3339 %></published>
+ <title><%= atom_title %></title>
+ <author><%= atom_author.atom %></author>
+ <% atom_categories.each do |c| %><%= c.atom %><% end %>
+ <% if atom_content %><content type="html"><%= SiteUtil::html_escape(atom_content) %></content><% end %>
+ <% if atom_rights %><rights type="html"><%= SiteUtil::html_escape(atom_rights) %></rights><% end %>
</entry>
diff --git a/tmpl/page.html.erb b/tmpl/page.html.erb
index dae08eb..fb5ddaa 100644
--- a/tmpl/page.html.erb
+++ b/tmpl/page.html.erb
@@ -29,7 +29,7 @@
</article>
<footer>
<%= atom_rights %>
- <p>Page source: <a href="<%= url.route_to(local_srcurl) %>"><%= File.basename(local_srcurl.to_s) %></a></p>
+ <% if local_srcurl %><p>Page source: <a href="<%= url.route_to(local_srcurl) %>"><%= File.basename(local_srcurl.to_s) %></a></p><% end %>
<p>Website source: <a href="https://git.andrewdm.me/www.git">www.git</a></p>
</footer>
</body>