X-Git-Url: https://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/8047c9c84ae645321839dd5fbeb59fd785c3ea5b..1dc021529f88ca4f1ebfed76ffe6378272a23032:/Rules diff --git a/Rules b/Rules index 547a0a9..477d46d 100644 --- a/Rules +++ b/Rules @@ -15,6 +15,24 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +preprocess do + commit = nil + Open3.popen2("git", "rev-parse", "HEAD") do |stdin, stdout, result| + stdin.close + val = stdout.gets + stdout.close + if result.value.success? then commit = val.chomp end + end + + if commit then + @items.each do |item| + if item_source(item) then + item[:gitrev] = commit + end + end + end +end + compile '/**/*.md' do filter :kramdown, header_offset: 1 layout '/default.xml'