Browse Source

link to exact build commit hash in public index footer

Nick Sweeting 1 year ago
parent
commit
c26d9dc1bb
2 changed files with 7 additions and 2 deletions
  1. 2 0
      archivebox/core/views.py
  2. 5 2
      archivebox/templates/core/base.html

+ 2 - 0
archivebox/core/views.py

@@ -23,6 +23,7 @@ from ..config import (
     PUBLIC_SNAPSHOTS,
     PUBLIC_SNAPSHOTS,
     PUBLIC_ADD_VIEW,
     PUBLIC_ADD_VIEW,
     VERSION,
     VERSION,
+    COMMIT_HASH,
     FOOTER_INFO,
     FOOTER_INFO,
     SNAPSHOTS_PER_PAGE,
     SNAPSHOTS_PER_PAGE,
 )
 )
@@ -217,6 +218,7 @@ class PublicIndexView(ListView):
         return {
         return {
             **super().get_context_data(**kwargs),
             **super().get_context_data(**kwargs),
             'VERSION': VERSION,
             'VERSION': VERSION,
+            'COMMIT_HASH': COMMIT_HASH,
             'FOOTER_INFO': FOOTER_INFO,
             'FOOTER_INFO': FOOTER_INFO,
         }
         }
 
 

+ 5 - 2
archivebox/templates/core/base.html

@@ -38,8 +38,11 @@
                     <br />
                     <br />
                     <center>
                     <center>
                         <small>
                         <small>
-                            Archive created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a> version
-                            <a href="https://github.com/ArchiveBox/ArchiveBox/releases/tag/v{{VERSION}}" title="Releases">v{{VERSION}}</a>.
+                            Archive created using <a href="https://github.com/ArchiveBox/ArchiveBox" title="Github">ArchiveBox</a>
+                            <a href="https://github.com/ArchiveBox/ArchiveBox/releases/tag/v{{VERSION}}" title="Releases">v{{VERSION}}</a>
+                            {% if COMMIT_HASH %}
+                                (<a href="https://github.com/ArchiveBox/ArchiveBox/commit/{{COMMIT_HASH}}"><code>{{COMMIT_HASH|truncatechars:9}}</code></a>)
+                            {% endif %}.
                             <br/><br/>
                             <br/><br/>
                             {{FOOTER_INFO}}
                             {{FOOTER_INFO}}
                         </small>
                         </small>