Something went wrong. Try again.
A static site generator for git repositories that integrates with git-bug to track issues. This is it.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133{{define "base"}}<!doctype html><html lang="en"> <head> <meta charset='utf-8'> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>{{template "title" .}}</title> <meta name="keywords" content="git code forge repo repository" /> <link rel="icon" type="image/png" href="{{.Repo.RootRelative}}{{.Repo.FaviconPath}}"> {{template "meta" .}} <style> /* Critical CSS - inlined to prevent FOUC */ :root { --line-height: 1.3rem; --grid-height: 0.65rem; --bg-color: #282a36; --text-color: #f8f8f2; --border: #6272a4; --link-color: #8be9fd; --hover: #ff79c6; --visited: #8be9fd; --white: #f2f2f2; --white-light: #f2f2f2; --white-dark: #e8e8e8; --grey: #414558; --grey-light: #6a708e; --code: #414558; --pre: #252525; --blockquote: #bd93f9; --blockquote-bg: #353548; --text-red: #ff5555; --text-green: #50fa7b; } html { background-color: var(--bg-color); color: var(--text-color); font-size: 16px; line-height: var(--line-height); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; -webkit-text-size-adjust: 100%; -moz-tab-size: 4; tab-size: 4; } body { margin: 0 auto; max-width: 900px; } *, ::before, ::after { box-sizing: border-box; } </style> <link rel="stylesheet" href="{{.Repo.RootRelative}}{{.Repo.CSSFile}}"> </head> <body hx-boost="true" hx-swap="innerHTML transition:true"> <header>{{template "header" .}}</header> <main>{{template "content" .}}</main> <hr /> <footer>{{template "footer" .}}</footer> <script> (function() { var MINUTE_MS = 60000; var HOUR_MS = 3600000; var DAY_MS = 86400000; var MONTH_MS = 30 * DAY_MS;
function updateTimes() { var elements = document.querySelectorAll('[data-time]'); var now = new Date(); var minDiffMs = Infinity;
elements.forEach(function(el) { var date = new Date(el.getAttribute('data-time')); var diffMs = now - date;
// Track the smallest difference for interval calculation if (diffMs < minDiffMs && diffMs >= 0) { minDiffMs = diffMs; }
var diffMins = Math.floor(diffMs / MINUTE_MS); var diffHours = Math.floor(diffMs / HOUR_MS); var diffDays = Math.floor(diffMs / DAY_MS);
var text; if (diffMins < 1) { text = 'just now'; } else if (diffMins < 60) { text = diffMins + ' minute' + (diffMins === 1 ? '' : 's') + ' ago'; } else if (diffHours < 24) { text = diffHours + ' hour' + (diffHours === 1 ? '' : 's') + ' ago'; } else if (diffDays < 30) { text = diffDays + ' day' + (diffDays === 1 ? '' : 's') + ' ago'; } else { // Keep default MMM dd format (already in element text) return; } el.textContent = text; });
return minDiffMs; }
function scheduleUpdate() { var minDiffMs = updateTimes(); var intervalMs;
// Determine interval based on smallest time difference if (minDiffMs < HOUR_MS) { // Smallest diff is in minutes - update every minute intervalMs = MINUTE_MS; } else if (minDiffMs < DAY_MS) { // Smallest diff is in hours - update every hour intervalMs = HOUR_MS; } else if (minDiffMs < MONTH_MS) { // Smallest diff is in days - update every day intervalMs = DAY_MS; } else { // All timestamps are > 30 days, no updates needed return; }
setTimeout(scheduleUpdate, intervalMs); }
scheduleUpdate(); })(); </script> <script type="module" src="https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-beta1/dist/htmx.esm.min.js" integrity="sha384-PcS7xfab7VmrX3d1pc3sw10FpukcW7k3kZT2sFgm1lti8gAT/ti9n9KEq/qRnfLT" crossorigin="anonymous"></script> </body></html>{{end}}