diff --git a/build.mb b/build.mb
index 84a31de..0c872ee 100644
--- a/build.mb
+++ b/build.mb
@@ -24,11 +24,13 @@ sector c_rules
bin/fpc-sitegen -i $(%input%) -o $(%output%)
COMMIT_SHORT=\$(git rev-parse --short HEAD)
+BRANCH=\$(git rev-parse --abbrev-ref HEAD)
DATE=\$(date +%d.%m.%Y)
TIME=\$(date +%H:%M:%S)
sed -i ''s/\\\$\\\$DATE\\\$\\\$/''"\$DATE/g" $(%output%)
sed -i ''s/\\\$\\\$TIME\\\$\\\$/''"\$TIME/g" $(%output%)
+sed -i ''s@\\\$\\\$BRANCH\\\$\\\$@''"\$BRANCH@g" $(%output%)
sed -i ''s@\\\$\\\$SOURCE\\\$\\\$@$(%input%)@g'' $(%output%)
sed -i ''s/\\\$\\\$COMMIT\\\$\\\$/''"\$COMMIT_SHORT/g" $(%output%)
'
diff --git a/data/template.sgt b/data/template.sgt
index f615493..6e527f6 100644
--- a/data/template.sgt
+++ b/data/template.sgt
@@ -58,7 +58,7 @@ output-format:
-
Last generated @ $$DATE$$, $$TIME$$ ; source $$SOURCE$$ @ commit $$COMMIT$$
+Last generated @ $$DATE$$, $$TIME$$ ; source $$SOURCE$$ @ commit $$COMMIT$$