summaryrefslogtreecommitdiff
path: root/tmpl
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-06 19:50:45 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-06 19:50:45 -0500
commit7edb003cd1c9b53ffdff11ef85532e39f08db16d (patch)
tree180db82a4af7720508ae2732393401bf4d27cadf /tmpl
parent7d875df65221d4da91953cf129a03e76fe8e5d29 (diff)
wip
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/index.atom.erb27
-rw-r--r--tmpl/index.md.erb12
-rw-r--r--tmpl/page.html.erb37
3 files changed, 76 insertions, 0 deletions
diff --git a/tmpl/index.atom.erb b/tmpl/index.atom.erb
new file mode 100644
index 0000000..cd70f7e
--- /dev/null
+++ b/tmpl/index.atom.erb
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title>AndrewDM.me <%= @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>
+
+ <% @pages.sort_by{|p| p.updated}.reverse.each do |page| %>
+ <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 %>
+ </entry>
+ <% end %>
+</feed>
diff --git a/tmpl/index.md.erb b/tmpl/index.md.erb
new file mode 100644
index 0000000..a3ec547
--- /dev/null
+++ b/tmpl/index.md.erb
@@ -0,0 +1,12 @@
+---
+title: "<%= @title %>"
+class: "index"
+---
+
+<% @sections.keys.sort.each do |path| %>
+<% unless path.empty? %>## [<%= @sections[path]['head'] %>](<%= path %>)<% end %>
+
+<% @sections[path]['body'].sort_by{|a|a.published}.reverse.each do |a| %>
+ * <span><a <% if a.is_a?(ExternPage) %>class="external" <% end %>href="<%= @url.route_to(a.url) %>" title="Published on <%= a.published.strftime('%Y-%m-%d') %><% if a.updated != a.published %> (updated on<%= a.updated.strftime('%Y-%m-%d') %>)<% end %>"><%= a.title %></a></span><span><% a.tags.each do |t| %><%= t.html %><% end %></span><% end %>
+
+<% end %>
diff --git a/tmpl/page.html.erb b/tmpl/page.html.erb
new file mode 100644
index 0000000..e2dc9fe
--- /dev/null
+++ b/tmpl/page.html.erb
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title><%= @page.title %><% unless @page.title.empty? %> — <% end %>AndrewDM</title>
+ <link rel="stylesheet" href="/main.css">
+ <link rel="alternate" type="application/atom+xml" href="/index.atom" />
+ <%= @page.head %>
+ </head>
+ <body<% if @page.class %> class="<%= @page.class %>"<% end %>>
+ <header>
+ <h1>AndrewDM</h1>
+ <nav>
+ <ul>
+ <li><a href="/">Projects</a>
+ <li><a href="/ChangeLog.html"><abbr title="Blog">Blahg</abbr></a>
+ <li><a href="/Andrew.html">Andrew</a>
+ <li>
+ <form method="GET" action="/search.html">
+ <input type=search name="s" placeholder="Search" /><input type=submit value="🔍" />
+ </form>
+ </ul>
+ </nav>
+ <p class=breadcrumbs><%= @page.breadcrumbs %></p>
+ </header>
+ <article>
+ <% if @page.tags.count > 0 %><p>Tags: <% @page.tags.each do |t| %><%= t.html %><% end %></p><% end %>
+ <% if @page.showtitle %><h1 class=title><%= @page.title %></h1><% end %>
+ <%= @page.content %>
+ </article>
+ <footer>
+ <%= @page.rights %>
+ <p>Page source: <a href="<%= @url.route_to(@page.srcurl) %>"><%= File.basename(@page.srcurl.to_s) %></a></p>
+ <p>Website source: <a href="https://git.andrewdm.me/www.git">www.git</a></p>
+ </footer>
+ </body>
+</html>