Permalink
Browse files

Merge pull request #91 from cuberite/updatedate

Link to latest commit and proper update date
  • Loading branch information...
bearbin committed Aug 31, 2017
2 parents e2011a0 + 442ab6b commit c3d0a99eb176facc2c6323b5aa45af2421f75d33
Showing with 6 additions and 4 deletions.
  1. +1 −1 .travis.yml
  2. +4 −2 generate.py
  3. +1 −1 template.html
View
@@ -8,5 +8,5 @@ before_install:
install:
- "pip install html5validator"
script:
- "python generate.py"
- "python3 generate.py"
- "html5validator --root out/"
View
@@ -135,10 +135,12 @@ def generate_content(toc, sections):
return "\n".join(content)
def generate_timestamp():
return time.strftime("%d %B %Y", time.localtime(time.time()))
date = time.strptime(subprocess.check_output(['git', 'log', '-1', '--format=%cd']).strip().decode(),
"%a %b %d %H:%M:%S %Y %z")
return time.strftime("%d %B %Y", date)
def generate_commit_id():
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode()
# Run the main function.
main()
View
@@ -24,7 +24,7 @@
<div id="manual">
<div id="manual-body">
<h2 class="manual">${title}</h2>
<p>Generated on ${timestamp}, Commit: ${commit_id}</p>
<p>Updated on ${timestamp}, Commit: <a href="https://github.com/cuberite/users-manual/commit/${commit_id}">${commit_id}</a></p>
${content}
</div>
</div>

0 comments on commit c3d0a99

Please sign in to comment.