Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5ad5b28
Add configuration to build siemens-internal with different baseURL
MarkvanMents Apr 7, 2026
bb1b929
Merge branch 'development' into MvM-PublishToSiemens
MarkvanMents Apr 17, 2026
d8006b7
Use canonifyURLs to resolve issues with linking in siemens-internal b…
MarkvanMents Apr 22, 2026
8654277
Turn on uglyURLs to see if Siemens server works better with those.
MarkvanMents May 28, 2026
d954dd4
Update documentation
MarkvanMents May 28, 2026
25676af
Add information about ugly urls to README
MarkvanMents May 29, 2026
3f9d7c6
Merge remote-tracking branch 'origin/development' into MvM-PublishToS…
MarkvanMents Jun 4, 2026
bc0e25a
Fix font loading for Siemens internal deployment
MarkvanMents Jun 5, 2026
72c67b5
Use relative paths for fonts in CSS
MarkvanMents Jun 5, 2026
f6e23db
Merge remote-tracking branch 'origin/development' into MvM-PublishToS…
MarkvanMents Jun 5, 2026
33893ea
Clarify command-line options
MarkvanMents Jun 5, 2026
6cbb836
Add proposal document for index.html issue
MarkvanMents Jun 8, 2026
ee966b3
Update baseURL for Siemens internal deployment
MarkvanMents Jun 16, 2026
6bacdfc
Merge remote-tracking branch 'origin/development' into MvM-PublishToS…
MarkvanMents Aug 24, 2026
07eda93
Add index.html post-processing script for Siemens deployment
MarkvanMents Aug 25, 2026
5f5ea1d
Include _print pages in index.html rewriting and clarify base URL req…
MarkvanMents Aug 25, 2026
a4f96fa
Rewrite directory links with anchors to include index.html
MarkvanMents Aug 25, 2026
f3a1e7d
Merge remote-tracking branch 'origin/development' into MvM-PublishToS…
MarkvanMents Sep 10, 2026
ed51043
Merge remote-tracking branch 'origin/development' into MvM-PublishToS…
MarkvanMents Sep 17, 2026
a4b3086
Add Siemens internal build-and-deploy workflow and supporting scripts
MarkvanMents Sep 18, 2026
f69cf59
Fix deploy job environment and shell script debug output
MarkvanMents Sep 18, 2026
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
115 changes: 115 additions & 0 deletions .github/workflows/siemens-internal-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Siemens Internal Build and Deploy

permissions:
contents: read

on:
# Allow manual runs from the Actions tab for testing without pushing to production/development
workflow_dispatch:
inputs:
dry_run:
description: 'Perform a dry run - do not upload any data'
required: true
default: true
type: boolean

jobs:
build:
runs-on: ubuntu-22.04
if: github.repository_owner == 'mendix'
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
# 20000 commits required for Hugo to populate last-modified dates on pages
fetch-depth: 20000
submodules: false
filter: blob:none

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci

- name: Report Hugo config
run: ./node_modules/.bin/hugo config --environment siemens-internal

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Build with Hugo
run: |
mkdir -p Built/Mendix-Docs/public
set -o pipefail
./node_modules/.bin/hugo --environment siemens-internal 2>&1 | \
sed 's/.*│ EN.*/```\n&/; s/.*Cleaned.*/&\n```/' | tee hugo.log

- name: Add index.html to directory links
run: |
bash _scripts/add-index-html-links.sh Built/Mendix-Docs/public \
https://internal.docs.sw.siemens.com/documentation/internal/PL20260323299104942/en-US/Mendix-Docs/public/

- name: Run htmltest
# htmltest errors are treated as warnings — build continues regardless (matches Travis behaviour)
run: |
chmod +x ./htmltest/htmltest
set +o pipefail
./htmltest/htmltest --conf .htmltest-siemens.yml 2>&1 | \
sed 's/\o033\[[0-9;]*[A-Za-z]//g; s/^=\+$/\n&/' | tee -a hugo.log
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
# add blank output line first as ::warning:: does not always trigger a warning annotation
echo " "
echo "::warning::htmltest found broken cross-references. See the Run htmltest step for details."
fi

- name: Print build log to GitHub Summary
if: always()
run: cat hugo.log >> $GITHUB_STEP_SUMMARY

- name: Upload public site artifact
uses: actions/upload-artifact@v7
with:
name: public-site
path: Built
if-no-files-found: error

deploy:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Download public site artifact
uses: actions/download-artifact@v8
with:
name: public-site
path: Built

- name: Set DRY_RUN
# Set the DRY_RUN environmental variable to indicate if dry_run input is set to true.
run: |
if [ "${{ inputs.dry_run }}" = "false" ]; then
echo "DRY_RUN=" >> "$GITHUB_ENV"
else
echo "DRY_RUN=--dryrun" >> "$GITHUB_ENV"
fi

- name: Upload to Siemens Support Center S3
# Use bash script to upload site to Siemens Support Center S3
# Use SSC secrets for Siemens Support Center - there are separate credentials for docs.mendix.com
# Secrets are restored at the Repository level.
run: bash _scripts/deploy-to-siemens.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SSC_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SSC_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.SSC_AWS_DEFAULT_REGION }}
50 changes: 50 additions & 0 deletions .htmltest-siemens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ==========================
# Configuration for HTMLTEST
# ==========================
# See documentation in repo: https://github.com/wjdp/htmltest
# Siemens-internal variant — points to the siemens-internal publishDir

DirectoryPath: "./Built/Mendix-Docs/public"
DirectoryIndex: "index.html"
FileExtension: .html
# Do not check external files - will want to do this monthly or so - implement later
CheckExternal: false
CheckMailto: false
# Not checking scripts for speed - should be OK as generated through HUGO
CheckScripts: false
CheckTel: false
IgnoreAltMissing: true
IgnoreDirectoryMissingTrailingSlash: false
IgnoreDirs:
- "_includes"
- "_print"
- "attachments"
- "css"
- "favicons"
- "icons"
- "js"
- "scss"
- "webfonts"
IgnoreEmptyHref: true
IgnoreInternalEmptyHash: true
IgnoreInternalURLs:
- "/misc/js/script.js"
- "/js/"
# HUGO generates a lot of tags which don't need to be tested
IgnoreTagAttribute: "data-proofer-ignore"
# Ignore URLs which return a 401/403 authentication error - might want to check these ignored URLs occasionally to ensure they are still valid.
# NOTE DOUBLE \\ needed to escape special characters in the string
IgnoreURLs:
- "example.com"
- "support.mendix.com.*"
- "sapes5.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC.*"
- "www.microsoft.com/en-us/download/details.aspx\\?id=11774"

# ==========================================================
# Speed up using concurrent testing by changing flag to true
# Using 4 concurrent documents halves the processing time
# EXPERIMENTAL - REMOVE IF THERE ARE PROBLEMS
#===========================================================

TestFilesConcurrently: false
DocumentConcurrencylimit: 4
85 changes: 85 additions & 0 deletions _scripts/add-index-html-links.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
# Post-processing script for Siemens internal deployment.
# Rewrites directory-style href links (ending with /) to explicit /index.html
# links in all HTML files under public/, so the Siemens server can serve them
# without requiring automatic directory index support.
#
# When built with the siemens-internal environment, canonifyURLs=true causes Hugo
# to expand all internal links to full absolute URLs using the baseURL. Pass that
# baseURL as the second argument so those links are rewritten too.
#
# Rewrites both plain directory links and directory links with anchors:
# href=".../path/" → href=".../path/index.html"
# href=".../path/#anchor" → href=".../path/index.html#anchor"
#
# Skips:
# - External links (contain :// but do not start with base-url)
# - Anchor-only links starting with #
# - Links already containing index.html or ending in .html/.htm
#
# Usage: bash _scripts/add-index-html-links.sh [public-dir] [base-url]
# Default public-dir: public
# Default base-url: (empty — only root-relative and relative links are rewritten)
#
# Example (siemens-internal build):
# bash _scripts/add-index-html-links.sh public \
# https://internal.docs.sw.siemens.com/documentation/internal/PL20260323299104942/en-US/Mendix-Docs/public/

set -euo pipefail

PUBLIC_DIR="${1:-public}"
BASE_URL="${2:-}"

if [ ! -d "$PUBLIC_DIR" ]; then
echo "Error: directory '$PUBLIC_DIR' not found. Run hugo build first." >&2
exit 1
fi

echo "Adding index.html to directory links in $PUBLIC_DIR..."
[ -n "$BASE_URL" ] && echo "Treating '$BASE_URL' as internal base URL."

python3 - "$PUBLIC_DIR" "$BASE_URL" << 'PYTHON'
import re, sys
from pathlib import Path

public_dir = sys.argv[1]
base_url = sys.argv[2].rstrip("/") + "/" if sys.argv[2] else ""

HREF_RE = re.compile(r"""(href=["'])([^"']*)(["'])""")

def rewrite_href(m):
pre, url, quote = m.group(1), m.group(2), m.group(3)

# Treat absolute URLs that start with base_url as internal; skip all others
if "://" in url:
if not (base_url and url.startswith(base_url)):
return m.group(0)

# Skip anchor-only links
if url.startswith("#"):
return m.group(0)

# Split off any fragment (e.g. /path/#anchor → path=/path/, fragment=#anchor)
fragment = ""
if "#" in url:
url, fragment = url.split("#", 1)
fragment = "#" + fragment

# Skip already-explicit file links
if url.endswith(".html") or url.endswith(".htm"):
return f"{pre}{url}{fragment}{quote}"

if url.endswith("/"):
url = url + "index.html"
return f"{pre}{url}{fragment}{quote}"

count = 0
for path in Path(public_dir).rglob("*.html"):
original = path.read_text(encoding="utf-8", errors="replace")
updated = HREF_RE.sub(rewrite_href, original)
if updated != original:
path.write_text(updated, encoding="utf-8")
count += 1

print(f"Updated {count} HTML files.")
PYTHON
41 changes: 41 additions & 0 deletions _scripts/deploy-to-siemens.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -ex

BUCKET=scp-prod-source
SIEMENS_EMAIL=mark.van.ments@siemens.com
RELEASE_ID=PL20260323299104942
LANG_CODE=en-US
TARGETAWSBUCKET=$BUCKET/$SIEMENS_EMAIL/$RELEASE_ID/$LANG_CODE/

echo "Deploying to Siemens AWS bucket $TARGETAWSBUCKET"



mkdir -p Built/Mendix-Docs/.meta
cp static/siemens-support-center-metadata/content.xlsx Built/Mendix-Docs/.meta/

cd Built
pwd
ls
# the AWS CLI is part of the standard GitHub runner
aws --version

# Requires the following environment variables (set as GitHub Actions secrets):
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_DEFAULT_REGION
#
# HUGO creates new files with a newer timestamp except those in the /static folder
# so this will always push all the html, but only changed /static files.
#
# Need to use old method - or a new method to reduce number of docs transferred.
# see https://stackoverflow.com/questions/1964470/whats-the-equivalent-of-subversions-use-commit-times-for-git/13284229#13284229 for a possibility
#
start=$SECONDS
echo "Starting sync to AWS"
aws s3 sync . s3://$TARGETAWSBUCKET --delete --only-show-errors --exclude "*.png" $DRY_RUN # sync all files except png files
aws s3 sync . s3://$TARGETAWSBUCKET --delete --only-show-errors --size-only --exclude "*" --include "*.png" $DRY_RUN # sync all png files
echo "Upload to AWS took $((SECONDS - start)) seconds"

exit 0
22 changes: 11 additions & 11 deletions assets/scss/_font-face.scss
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
@font-face { // LZ - Added for MxDock by request 2024-01-30
font-family: "noto-sans";
src: local("noto-sans"), url("/fonts/noto-sans/noto-sans-400.woff2") format("woff2");
src: local("noto-sans"), url("../fonts/noto-sans/noto-sans-400.woff2") format("woff2");
font-style: normal;
font-weight: 400;
font-display: swap;
}

@font-face {
font-family: "noto-sans";
src: local("noto-sans"), url("/fonts/noto-sans/noto-sans-400-italic.woff2") format("woff2");
src: local("noto-sans"), url("../fonts/noto-sans/noto-sans-400-italic.woff2") format("woff2");
font-style: italic;
font-weight: 400;
font-display: swap;
}

@font-face {
font-family: "noto-sans";
src: local("noto-sans"), url("/fonts/noto-sans/noto-sans-600.woff2") format("woff2");
src: local("noto-sans"), url("../fonts/noto-sans/noto-sans-600.woff2") format("woff2");
font-style: normal;
font-weight: 600;
font-display: swap;
}

@font-face {
font-family: "noto-sans";
src: local("noto-sans"), url("/fonts/noto-sans/noto-sans-600-italic.woff2") format("woff2");
src: local("noto-sans"), url("../fonts/noto-sans/noto-sans-600-italic.woff2") format("woff2");
font-style: italic;
font-weight: 600;
font-display: swap;
}

/* Medium */
@font-face {
font-family: "Patron";
font-style: normal;
font-weight: 500;
font-display: swap;
src: local("Patron Medium"), local("Patron-Medium"),
url("/fonts/patron/PatronWEB-Medium.woff2") format("woff2");
url("../fonts/patron/PatronWEB-Medium.woff2") format("woff2");
}

/* Light */
@font-face {
font-family: "Patron";
font-style: normal;
font-weight: 300;
font-display: swap;
src: local("Patron Light"), local("Patron-Light"),
url("/fonts/patron/PatronWEB-Light.woff2") format("woff2");
url("../fonts/patron/PatronWEB-Light.woff2") format("woff2");
}

/* The main font is Noto Sans */
Expand Down
Loading