From b6b8be24a705d0c9d710066751480304dd64d758 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 12 Jul 2022 13:53:34 -0300 Subject: experimental site header in generated HTML --- src/upd8.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/upd8.js b/src/upd8.js index 7f05fba4..4861139d 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -54,6 +54,8 @@ import { unlink, } from 'fs/promises'; +import { execSync } from 'child_process'; + import genThumbs from './gen-thumbs.js'; import {listingSpec, listingTargetSpec} from './listing-spec.js'; import urlSpec from './url-spec.js'; @@ -151,6 +153,15 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); const CACHEBUST = 11; +let COMMIT; +try { + COMMIT = execSync('git log --format="%h %B" -n 1 HEAD').toString().trim(); +} catch (error) { + COMMIT = '(failed to detect)'; +} + +const BUILD_TIME = new Date(); + const DEFAULT_STRINGS_FILE = 'strings-default.json'; // Code that's common 8etween the 8uild code (i.e. upd8.js) and gener8ted @@ -1219,6 +1230,31 @@ writePage.html = ( 'data-rebase-media': to('media.root'), 'data-rebase-data': to('data.root'), })}> + ${ showWikiNameInTitle -- cgit 1.3.0-6-gf8a5