diff --git a/index.js b/index.js index 001a651..c483ec1 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,18 @@ app.locals.siteMap = [ link: "about", description: "who runs abtmtr.link?" } -] +]; +app.locals.curCommit = "0000000000"; + +async function getCurCommit() { + const curCommit = await fetch("https://git.abtmtr.link/api/v1/repos/MeowcaTheoRange/abtmtr-v13/branches/main") + .catch(() => res.status(500).send()) + .then((res) => res.json()); + + app.locals.curCommit = curCommit.commit.id.substr(0, 10); +} + +getCurCommit(); app.get('/', async (req, res) => { const statusesJson = await fetch("https://cdn.abtmtr.link/site_content/v13/statuses.json") diff --git a/views/components/footer.ejs b/views/components/footer.ejs index b84d3ed..150d30f 100644 --- a/views/components/footer.ejs +++ b/views/components/footer.ejs @@ -1,5 +1,5 @@