put commit in footer!

This commit is contained in:
24c02 2025-01-03 19:10:34 -05:00
parent e55d98b34d
commit 228ff57bf0
2 changed files with 9 additions and 1 deletions

View file

@ -15,6 +15,14 @@ class ShipmentViewer < Sinatra::Base
set :host_authorization, permitted_hosts: []
def footer_commit
@footer_commit ||= if ENV['VERCEL_GIT_COMMIT_SHA']
"rev #{ENV['VERCEL_GIT_COMMIT_SHA'][...7]}"
else
"development!"
end
end
def gen_url(email)
"#{ENV['BASE_URL']}/dyn/shipments/#{email}?signature=#{sign(email)}"
end

View file

@ -39,7 +39,7 @@
<% if @internal %>
<p><%= ["don't do anything i wouldn't do", "agent 47! welcome!", "i ship it :3"].sample %></p>
<% end %>
<p>with <3 from <a target="_blank" href="https://hackclub.com/">Hack Club</a>! open-source'd @ <a target="_blank" href="https://github.com/hackclub/shipment-viewer">hackclub/shipment-viewer</a> <i class="fa-brands fa-github"></i>.</p>
<p>with <3 from <a target="_blank" href="https://hackclub.com/">Hack Club</a>! open-source'd&nbsp@&nbsp<a target="_blank" href="https://github.com/hackclub/shipment-viewer">hackclub/shipment-viewer</a>&nbsp<i class="fa-brands fa-github"></i> (<%= footer_commit %>)</p>
</div>
</div>