aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/document.html.erb69
-rw-r--r--templates/feed.xml.erb27
-rw-r--r--templates/posts_list.html.erb59
-rw-r--r--templates/section.html.erb19
-rw-r--r--templates/sitemap.xml.erb11
-rw-r--r--templates/tag.html.erb59
6 files changed, 244 insertions, 0 deletions
diff --git a/templates/document.html.erb b/templates/document.html.erb
new file mode 100644
index 0000000..9d93696
--- /dev/null
+++ b/templates/document.html.erb
@@ -0,0 +1,69 @@
+<% _main_stylesheet = '/style.css' %>
+<% _author = attr 'author' %>
+<% _description = attr 'description' %>
+<% _lang = attr 'lang' %>
+<% _site_copyright_year = attr 'site-copyright-year' %>
+<% _copyright_year = attr 'copyright-year' %>
+<% _revisions = attr 'revision-history' %>
+<% _site_name = attr 'site-name' %>
+<% _tags = attr 'tags' %>
+<% _doctitle = doctitle %>
+<% _header_title = header.title %>
+<% _content = content %>
+<!DOCTYPE html>
+<html lang="<%= _lang %>">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="<%= _author %>">
+ <meta name="copyright" content="&copy; <%= _copyright_year %> <%= _author %>">
+ <meta name="description" content="<%= _description %>">
+ <meta name="keywords" content="<%= _tags.map(&:label).join(',') %>">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title><%= _doctitle %> | <%= _site_name %></title>
+ <link rel="stylesheet" href="/hl.css">
+ <link rel="stylesheet" href="<%= _main_stylesheet %>">
+ <link rel="stylesheet" href="/custom.css">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <p class="logo">
+ <a href="/"><%= _site_name %></a>
+ </p>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title"><%= _header_title %></h1>
+ <% if not _tags.empty? %>
+ <ul class="post-tags">
+ <% for tag in _tags %>
+ <li class="tag">
+ <a href="/tags/<%= tag.slug %>/"><%= tag.label %></a>
+ </li>
+ <% end %>
+ </ul>
+ <% end %>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <% for revision in _revisions %>
+ <li class="revision">
+ <time datetime="<%= revision.date %>"><%= revision.date %></time>: <%= revision.remark %>
+ </li>
+ <% end %>
+ </ol>
+ </section>
+ <%= _content %>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; <%= _site_copyright_year %> <%= _author %>
+ </footer>
+ </body>
+</html>
diff --git a/templates/feed.xml.erb b/templates/feed.xml.erb
new file mode 100644
index 0000000..7ebd1ba
--- /dev/null
+++ b/templates/feed.xml.erb
@@ -0,0 +1,27 @@
+<% _feed_title = feed_title %>
+<% _link = link %>
+<% _description = description %>
+<% _lang = lang %>
+<% _last_build_date = last_build_date %>
+<% _feed_link = feed_link %>
+<% _posts = posts %>
+<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title><%= _feed_title %></title>
+ <link><%= _link %></link>
+ <description><%= _description %></description>
+ <language><%= _lang %></language>
+ <lastBuildDate><%= _last_build_date %></lastBuildDate>
+ <atom:link href="<%= _feed_link %>" rel="self" type="application/rss+xml" />
+ <% for post in _posts %>
+ <item>
+ <title><%= post.title %></title>
+ <link><%= post.href %></link>
+ <pubDate><%= post.updated_on %></pubDate>
+ <guid><%= post.href %></guid>
+ <description><![CDATA[<%= post %>]]></description>
+ </item>
+ <% end %>
+ </channel>
+</rss>
diff --git a/templates/posts_list.html.erb b/templates/posts_list.html.erb
new file mode 100644
index 0000000..2227241
--- /dev/null
+++ b/templates/posts_list.html.erb
@@ -0,0 +1,59 @@
+<% _main_stylesheet = '/style.css' %>
+<% _author = author %>
+<% _description = description %>
+<% _lang = lang %>
+<% _site_copyright_year = site_copyright_year %>
+<% _copyright_year = copyright_year %>
+<% _site_name = site_name %>
+<% _doctitle = doctitle %>
+<% _header_title = header_title %>
+<% _posts = posts %>
+<!DOCTYPE html>
+<html lang="<%= _lang %>">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="<%= _author %>">
+ <meta name="copyright" content="&copy; <%= _copyright_year %> <%= _author %>">
+ <meta name="description" content="<%= _description %>">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title><%= _doctitle %> | <%= _site_name %></title>
+ <link rel="stylesheet" href="/hl.css">
+ <link rel="stylesheet" href="<%= _main_stylesheet %>">
+ <link rel="stylesheet" href="/custom.css">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <p class="logo">
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </p>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1><%= _header_title %></h1>
+ </header>
+ <% for post in _posts %>
+ <article class="post-entry">
+ <a href="<%= post.attributes['href'] %>">
+ <header class="entry-header">
+ <h2><%= post.doctitle %></h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ <%= post.attributes['description'] %>
+ </p>
+ </section>
+ <footer class="entry-footer">
+ Posted on <time datetime="<%= post.attributes['revision-history'].first.date %>"><%= post.attributes['revision-history'].first.date %></time><% if post.attributes['revision-history'].length > 1 %>, updated on <time datetime="<%= post.attributes['revision-history'].last.date %>"><%= post.attributes['revision-history'].last.date %></time><% end %>
+ </footer>
+ </a>
+ </article>
+ <% end %>
+ </main>
+ <footer class="footer">
+ &copy; <%= _site_copyright_year %> <%= _author %>
+ </footer>
+ </body>
+</html>
diff --git a/templates/section.html.erb b/templates/section.html.erb
new file mode 100644
index 0000000..1510595
--- /dev/null
+++ b/templates/section.html.erb
@@ -0,0 +1,19 @@
+<% _level = level %>
+<% _role = role %>
+<% _id = id %>
+<% _title = caption ? captioned_title : title %>
+<% _content = content %>
+<section class="section-<%= _level %><%= _role ? " #{role}" : '' %>">
+ <h<%= _level + 1 %> id="<%= _id %>" class="section-header">
+ <% if _id %>
+ <a href="#<%= _id %>">
+ <%= _title %>
+ </a>
+ <% else %>
+ <%= _title %>
+ <% end %>
+ </h<%= _level + 1 %>>
+ <div class="section-body">
+ <%= _content %>
+ </div>
+</section>
diff --git a/templates/sitemap.xml.erb b/templates/sitemap.xml.erb
new file mode 100644
index 0000000..304b1c6
--- /dev/null
+++ b/templates/sitemap.xml.erb
@@ -0,0 +1,11 @@
+<% _base_url = base_url %>
+<% _pages = pages %>
+<?xml version="1.0" encoding="utf-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" >
+ <% for page in _pages %>
+ <url>
+ <loc><%= _base_url %><%= page.href %></loc>
+ <lastmod><%= page.updated_on %></lastmod>
+ </url>
+ <% end %>
+</urlset>
diff --git a/templates/tag.html.erb b/templates/tag.html.erb
new file mode 100644
index 0000000..7fd23cd
--- /dev/null
+++ b/templates/tag.html.erb
@@ -0,0 +1,59 @@
+<% _main_stylesheet = '/style.css' %>
+<% _author = author %>
+<% _description = description %>
+<% _lang = lang %>
+<% _site_copyright_year = site_copyright_year %>
+<% _copyright_year = copyright_year %>
+<% _site_name = site_name %>
+<% _doctitle = tag.label %>
+<% _header_title = tag.label %>
+<% _posts = posts %>
+<!DOCTYPE html>
+<html lang="<%= _lang %>">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="<%= _author %>">
+ <meta name="copyright" content="&copy; <%= _copyright_year %> <%= _author %>">
+ <meta name="description" content="<%= _description %>">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title><%= _doctitle %> | <%= _site_name %></title>
+ <link rel="stylesheet" href="/hl.css">
+ <link rel="stylesheet" href="<%= _main_stylesheet %>">
+ <link rel="stylesheet" href="/custom.css">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <p class="logo">
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </p>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1><%= _header_title %></h1>
+ </header>
+ <% for post in _posts %>
+ <article class="post-entry">
+ <a href="<%= post.attributes['href'] %>">
+ <header class="entry-header">
+ <h2><%= post.doctitle %></h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ <%= post.attributes['description'] %>
+ </p>
+ </section>
+ <footer class="entry-footer">
+ Posted on <time datetime="<%= post.attributes['revision-history'].first.date %>"><%= post.attributes['revision-history'].first.date %></time><% if post.attributes['revision-history'].length > 1 %>, updated on <time datetime="<%= post.attributes['revision-history'].last.date %>"><%= post.attributes['revision-history'].last.date %></time><% end %>
+ </footer>
+ </a>
+ </article>
+ <% end %>
+ </main>
+ <footer class="footer">
+ &copy; <%= _site_copyright_year %> <%= _author %>
+ </footer>
+ </body>
+</html>