File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import subprocess
2
3
import time
3
4
4
5
# !! This is the configuration of Nikola. !! #
964
965
<div class="row text-center">
965
966
<div class="col">
966
967
<p>Comunidad Python Ecuador</p>
968
+ <p>Commit: {commit}</p>
967
969
<small>© {date} Todos los derechos reservados.</small>
968
970
<p>
969
971
<small>
989
991
# still needs to be a dict of this format. (it can be empty if you
990
992
# do not need formatting)
991
993
# (translatable)
994
+ def get_last_commit ():
995
+ encoding = 'utf-8'
996
+ command = subprocess .run (["git" , "rev-parse" , "HEAD" ], capture_output = True )
997
+ return command .stdout .decode (encoding )
998
+
992
999
CONTENT_FOOTER_FORMATS = {
993
1000
DEFAULT_LANG : (
994
1001
(),
995
1002
{
996
1003
"email" : BLOG_EMAIL ,
997
1004
"author" : BLOG_AUTHOR ,
998
1005
"date" : time .gmtime ().tm_year ,
999
- "license" : LICENSE
1006
+ "license" : LICENSE ,
1007
+ "commit" : get_last_commit ()
1000
1008
}
1001
1009
)
1002
1010
}
You can’t perform that action at this time.
0 commit comments