diff --git a/CMakeLists.txt b/CMakeLists.txt index 35bd609..a8d01da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,7 @@ execute_process( # Get the date and time of last commit execute_process( - COMMAND git log -1 --format=%cd + COMMAND git log -1 --format=%cd --date=short WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_DATETIME OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/src/page.h b/src/page.h index d3d4010..3e2339a 100644 --- a/src/page.h +++ b/src/page.h @@ -3624,9 +3624,18 @@ namespace xmreg { string get_full_page(string& middle) { + // set last git commit date based on + // autogenrated version.h during compilation + static const mstch::map footer_context { + {"last_git_commit_hash", string {GIT_COMMIT_HASH}}, + {"last_git_commit_date", string {GIT_COMMIT_DATETIME}} + }; + + string footer_html = mstch::render(xmreg::read(TMPL_FOOTER), footer_context); + return xmreg::read(TMPL_HEADER) + middle - + xmreg::read(TMPL_FOOTER); + + footer_html; } void diff --git a/src/templates/footer.html b/src/templates/footer.html index c59bde4..f84a351 100644 --- a/src/templates/footer.html +++ b/src/templates/footer.html @@ -5,9 +5,10 @@
Help support the hosting and maintenance of this service by donating to:
48daf1rG3hE1Txapcsxh6WXNe9MLNKtu7W7tKTivtSoVLHErYzvdcpea2nSTgGkz66RFP4GKVAsTV14v6G3oddBTHfxP6tU +

+ Version: {{last_git_commit_date}}
-