Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/website-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ jobs:
WEBSITE_INCLUDE_DEVGUIDE: "true"
WEBSITE_INCLUDE_INITIALIZR: "auto"
WEBSITE_INCLUDE_PLAYGROUND: "auto"
# PR previews build with future-dated posts visible so reviewers
# can read posts staged for later in the week. Production deploys
# (push to master) keep the default so future posts only appear
# on their actual date.
HUGO_BUILD_FUTURE: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
CN1_USER: ${{ secrets.CN1_USER }}
CN1_TOKEN: ${{ secrets.CN1_TOKEN }}

Expand Down
292 changes: 292 additions & 0 deletions docs/website/content/blog/developer-workflow-debug-and-junit.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/website/layouts/partials/extend_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- /* Intentionally left empty. The {{< mermaid >}} shortcode emits its own
loader inline so the diagram works regardless of partialCached behaviour
on the surrounding footer. */ -}}
38 changes: 38 additions & 0 deletions docs/website/layouts/shortcodes/mermaid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{/*
Mermaid diagram shortcode.

Usage:
{{< mermaid >}}
flowchart LR
A[IDE] -->|JDWP| B[CN1 Debug Proxy]
B -->|wire protocol| C[iOS app]
{{< /mermaid >}}

The loader is inlined here (rather than gated from a footer partial)
because the PaperMod footer is rendered with partialCached, which would
cache a single result across every page sharing the same layout / kind.
Multiple shortcodes on one page emit multiple loader scripts; the
__cn1MermaidLoaded guard makes initialisation idempotent.
*/}}
<div class="cn1-mermaid mermaid">
{{- .Inner | safeHTML -}}
</div>
<script>
(function () {
if (window.__cn1MermaidLoaded) return;
window.__cn1MermaidLoaded = true;
var s = document.createElement("script");
s.type = "module";
s.textContent =
'import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";' +
'var prefersDark = document.body.classList.contains("dark")' +
' || window.matchMedia("(prefers-color-scheme: dark)").matches;' +
'mermaid.initialize({' +
' startOnLoad: true,' +
' theme: prefersDark ? "dark" : "default",' +
' securityLevel: "loose",' +
' fontFamily: "Poppins, system-ui, sans-serif"' +
'});';
document.head.appendChild(s);
})();
</script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion scripts/website/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ HUGO_BIN="${HUGO_BIN:-hugo}"
HUGO_ENVIRONMENT="${HUGO_ENVIRONMENT:-production}"
HUGO_MINIFY="${HUGO_MINIFY:-true}"
HUGO_BASEURL="${HUGO_BASEURL:-https://www.codenameone.com/}"
# When true, include posts whose front-matter date is in the future
# (e.g. weekly release posts staged for later in the week). Off by
# default so the live site only shows posts whose publish date has
# arrived; PR previews flip this on so reviewers can read the draft.
HUGO_BUILD_FUTURE="${HUGO_BUILD_FUTURE:-false}"
# When true, include posts marked draft: true.
HUGO_BUILD_DRAFTS="${HUGO_BUILD_DRAFTS:-false}"
PYTHON_BIN="${PYTHON_BIN:-python3}"
WEBSITE_INCLUDE_JAVADOCS="${WEBSITE_INCLUDE_JAVADOCS:-false}"
WEBSITE_INCLUDE_DEVGUIDE="${WEBSITE_INCLUDE_DEVGUIDE:-auto}"
Expand Down Expand Up @@ -765,11 +772,23 @@ if [ "${HUGO_MINIFY}" = "true" ]; then
MINIFY_FLAG="--minify"
fi

BUILD_FUTURE_FLAG=""
if [ "${HUGO_BUILD_FUTURE}" = "true" ]; then
BUILD_FUTURE_FLAG="--buildFuture"
fi

BUILD_DRAFTS_FLAG=""
if [ "${HUGO_BUILD_DRAFTS}" = "true" ]; then
BUILD_DRAFTS_FLAG="--buildDrafts"
fi

HUGO_ENV="${HUGO_ENVIRONMENT}" "${HUGO_BIN}" \
--cleanDestinationDir \
--gc \
--baseURL "${HUGO_BASEURL}" \
${MINIFY_FLAG}
${MINIFY_FLAG} \
${BUILD_FUTURE_FLAG} \
${BUILD_DRAFTS_FLAG}

if command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
"${PYTHON_BIN}" "${WEBSITE_DIR}/scripts/generate_lunr_index.py"
Expand Down
Loading