From d431c2f2abb2078f83b56f0ef1d42d3b75731306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20Thei=C3=9Fen?= Date: Thu, 11 Apr 2024 12:15:36 +0200 Subject: [PATCH] Inject GitHub info into build step (#250) Co-authored-by: Ralf Handl --- lib/pages.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pages.js b/lib/pages.js index e393514f..644542f3 100644 --- a/lib/pages.js +++ b/lib/pages.js @@ -1,7 +1,8 @@ const pandoc = require("./pandoc"); const fs = require("fs"); -const VOCAB = require("../package.json").name; +const PKG = require("../package.json"); +const GITHUB_REPO = PKG.repository.url.match(/^git\+(.*?)\.git$/)[1]; const REPO = process.argv[process.argv.length - 1]; function file(dir, title, filename) { @@ -14,9 +15,10 @@ function file(dir, title, filename) { ), }, { - "-c": `/${VOCAB}/styles/style.css`, + "-c": `/${PKG.name}/styles/style.css`, "-F": `${__dirname}/md2html.js`, "-M": `title=${REPO}${title ? " - " + title : ""}`, + "-V": [`github-repo=${GITHUB_REPO}`, `github-path=${dir}/${filename}`], "--template": "assets/template", }, );