summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-09-30 18:24:14 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-09-30 18:24:14 -0400
commit60573896b4d4cc6820172cc9ad2d4355f7168662 (patch)
tree2c26fdefa9e1edcba31d755b0632fd417d97a71a
parent6f7d74f8a0c5a77441b34e3b42950c18127da3d7 (diff)
sitegen stuff
-rw-r--r--Makefile2
-rw-r--r--index.atom.erb4
-rwxr-xr-xpost-commit5
-rw-r--r--util.rb8
4 files changed, 9 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 0275851..05a557a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+SHELL = bash -o pipefail
+
articles = $(sort $(filter-out public/index,$(patsubst %.md,%,$(wildcard public/*.md))))
all: public/index.html public/index.atom $(addsuffix .html,$(articles))
diff --git a/index.atom.erb b/index.atom.erb
index 208e15d..a5e1586 100644
--- a/index.atom.erb
+++ b/index.atom.erb
@@ -5,7 +5,7 @@
<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.gitdate}.sort.last.rfc3339 %></updated>
+ <updated><%= @pages.map{|p|p.date}.sort.last.rfc3339 %></updated>
<author><%= Person.new("Luke Shumaker").atom %></author>
<id>https://lukeshu.com/blog/</id>
@@ -14,7 +14,7 @@
<link rel="alternate" type="text/html" href="./<%= page.slug %>.html"/>
<link rel="alternate" type="text/markdown" href="./<%= page.slug %>.md"/>
<id>https://lukeshu.com/blog/<%= page.slug %>.html</id>
- <updated><%= page.gitdate.rfc3339 %></updated>
+ <updated><%= page.date.rfc3339 %></updated>
<published><%= page.date.rfc3339 %></published>
<title><%= page.title %></title>
<content type="html"><%= html_escape(page.content) %></content>
diff --git a/post-commit b/post-commit
index 09d2f7f..6abf27a 100755
--- a/post-commit
+++ b/post-commit
@@ -2,10 +2,15 @@
branch=$(git name-rev --name-only HEAD)
if [[ $branch == master ]]; then
+ git add .
+ git stash
+
git checkout pre-generated
git merge master -m 'bogus'
make --always-make -j12
git add .
git commit --amend -m "make: $(git log -n1 master --pretty=format:%B)"
+
git checkout master
+ git stash pop
fi
diff --git a/util.rb b/util.rb
index 160a74d..31c605f 100644
--- a/util.rb
+++ b/util.rb
@@ -84,14 +84,6 @@ class Page
def slug ; @slug ||= infile.sub(/\..*$/,'').sub(/^.*\//,'') ; end
def content ; @content ||= pandoc.to('html5') ; end
- def gitdate
- if @gitdate.nil?
- raw = `git log -n1 --format='%cI' -- #{infile}`
- @gitdate = DateTime.iso8601(raw) unless raw.empty?
- end
- @gitdate
- end
-
def rights
@rights ||= "<p>The content of this page is Copyright © #{date.year unless date.nil?} #{author.html}.</p>\n" +
"<p>This page is licensed under the #{license.html} license.</p>"