commit c276126b2fab0bb979dafd4a55d4502803d99583 parent 70b52538bf549f56c4cfef67423d4789ac0fdf57 Author: arjoonn <arjoonn@midpathsoftware.com> Date: Thu, 26 Feb 2026 13:59:48 +0530 x Diffstat:
| M | README.md | | | 2 | +- |
| M | scripts/build_site.sh | | | 43 | ++++++++++++++++++++++++++++++++++++++++--- |
2 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md @@ -1,4 +1,4 @@ -# Jaypore CI +# Jaypore CI - Docs > Minimal, Offline, Local CI system. diff --git a/scripts/build_site.sh b/scripts/build_site.sh @@ -31,12 +31,49 @@ cp -r "${REPO_DIR}/bin" "${PUBLIC_DIR}/binaries" (cd "${BUILD_DIR}" && pwd && stagit -u /releases/git "${REPO_DIR}") cp -r "${BUILD_DIR}/." "${RELEASES_DIR}" -# Render README.md to HTML and replace the stagit-generated version +# Render README.md to HTML and replace the stagit-generated content README_SRC="${REPO_DIR}/README.md" README_DST="${RELEASES_DIR}/file/README.md.html" -if [[ -f "${README_SRC}" ]]; then +if [[ -f "${README_SRC}" && -f "${README_DST}" ]]; then echo "Rendering README.md to HTML via lowdown..." - lowdown -o "${README_DST}" "${README_SRC}" + README_RENDERED="$(mktemp)" + lowdown -o "${README_RENDERED}" "${README_SRC}" + echo "Injecting rendered README into ${README_DST}" + README_TMP_OUTPUT="$(mktemp)" + awk -v rendered="${README_RENDERED}" ' +BEGIN { + in_content = 0 + inserted = 0 +} +{ + if (!inserted && $0 ~ /<div id="content">/) { + print + while ((getline line < rendered) > 0) { + print line + } + close(rendered) + in_content = 1 + inserted = 1 + next + } + if (in_content) { + if ($0 ~ /<\/div>/) { + print $0 + in_content = 0 + } + next + } + print +} +END { + if (!inserted) { + print "Failed to inject rendered README: <div id=\"content\"> not found" > "/dev/stderr" + exit 1 + } +} +' "${README_DST}" > "${README_TMP_OUTPUT}" + mv "${README_TMP_OUTPUT}" "${README_DST}" + rm -f "${README_RENDERED}" fi # Clean up the temporary description file