Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import subprocess
import time

# !! This is the configuration of Nikola. !! #
Expand Down Expand Up @@ -965,12 +966,16 @@
<div class="col">
<p>Comunidad Python Ecuador</p>
<small>© {date} Todos los derechos reservados.</small>
<p>
<small>
¿Encontraste un error?
<a href="https://python.ec/guias/colaborar/#reportando-errores-bugs">¡Repórtalo!</a>
</small>
</p>
<br>
<small>
¿Encontraste un error?
<a href="https://python.ec/guias/colaborar/#reportando-errores-bugs">¡Repórtalo!</a>
</small>
<br>
<small>
commit:
<a href="https://github.com/pythonecuador/pythonecuador.github.io/commit/{commit}">{commit}</a>
</small>
</div>
</div>
</div>
Expand All @@ -989,14 +994,21 @@
# still needs to be a dict of this format. (it can be empty if you
# do not need formatting)
# (translatable)
def get_last_commit():
encoding = 'utf-8'
command = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True)
last_hash = command.stdout.decode(encoding)
return last_hash[0:8]

CONTENT_FOOTER_FORMATS = {
DEFAULT_LANG: (
(),
{
"email": BLOG_EMAIL,
"author": BLOG_AUTHOR,
"date": time.gmtime().tm_year,
"license": LICENSE
"license": LICENSE,
"commit": get_last_commit()
}
)
}
Expand Down