Version from git added into template footer

This commit is contained in:
moneroexamples 2016-11-23 09:59:22 +08:00
parent 930787d74d
commit 46205ab08d
3 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -5,9 +5,10 @@
<h6 style="margin-top:10px">
Help support the hosting and maintenance of this service by donating to: <br/>
48daf1rG3hE1Txapcsxh6WXNe9MLNKtu7W7tKTivtSoVLHErYzvdcpea2nSTgGkz66RFP4GKVAsTV14v6G3oddBTHfxP6tU
<br/><br/>
Version: {{last_git_commit_date}}
</h6>
</div>
</body>
</html>