Version from git added into template footer

master
moneroexamples 8 years ago
parent 930787d74d
commit 46205ab08d

@ -119,7 +119,7 @@ execute_process(
# Get the date and time of last commit # Get the date and time of last commit
execute_process( execute_process(
COMMAND git log -1 --format=%cd COMMAND git log -1 --format=%cd --date=short
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_DATETIME OUTPUT_VARIABLE GIT_COMMIT_DATETIME
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE

@ -3624,9 +3624,18 @@ namespace xmreg {
string string
get_full_page(string& middle) 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) return xmreg::read(TMPL_HEADER)
+ middle + middle
+ xmreg::read(TMPL_FOOTER); + footer_html;
} }
void void

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

Loading…
Cancel
Save