# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+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'