From 60573896b4d4cc6820172cc9ad2d4355f7168662 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 30 Sep 2016 18:24:14 -0400 Subject: sitegen stuff --- Makefile | 2 ++ index.atom.erb | 4 ++-- post-commit | 5 +++++ util.rb | 8 -------- 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 @@ - <%= @pages.map{|p|p.gitdate}.sort.last.rfc3339 %> + <%= @pages.map{|p|p.date}.sort.last.rfc3339 %> <%= Person.new("Luke Shumaker").atom %> https://lukeshu.com/blog/ @@ -14,7 +14,7 @@ https://lukeshu.com/blog/<%= page.slug %>.html - <%= page.gitdate.rfc3339 %> + <%= page.date.rfc3339 %> <%= page.date.rfc3339 %> <%= page.title %> <%= html_escape(page.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 ||= "

The content of this page is Copyright © #{date.year unless date.nil?} #{author.html}.

\n" + "

This page is licensed under the #{license.html} license.

" -- cgit v1.2.3