Skip to content

feat: add everyday content primitives #9

feat: add everyday content primitives

feat: add everyday content primitives #9

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
build:
name: Hugo ${{ matrix.hugo-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
hugo-version: ['0.160.1', '0.164.0']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.x'
- uses: peaceiris/actions-hugo@v3
with:
hugo-version: ${{ matrix.hugo-version }}
extended: true
- name: Check translation key parity
run: python3 scripts/check-i18n.py
- name: Check typography token boundaries
run: python3 scripts/check-font-tokens.py
- name: Check content primitive contract
run: python3 scripts/check-content-primitives-contract.py
- name: Build the example site without warnings
working-directory: exampleSite
run: hugo --printPathWarnings --panicOnWarning
- name: Check enhanced code-block contracts
run: python3 scripts/check-code-blocks.py
- name: Check everyday content primitives
run: python3 scripts/check-content-primitives.py
- name: Check shared media primitives
run: python3 scripts/check-media-primitives.py
- name: Check opt-in Image Zoom
run: python3 scripts/check-image-zoom.py
- name: Check Gallery output and Zoom reuse
run: python3 scripts/check-gallery.py
- name: Build the system typography preset
working-directory: exampleSite
env:
HUGO_PARAMS_UI_TYPOGRAPHY_PRESET: system
run: |
hugo --destination "$RUNNER_TEMP/oink-system" --printPathWarnings --panicOnWarning
grep -R -q 'data-td-typography="system"' "$RUNNER_TEMP/oink-system"
- name: Preserve legacy Sass font overrides
run: |
cp -R exampleSite "$RUNNER_TEMP/oink-font-compat"
mkdir -p "$RUNNER_TEMP/oink-font-compat/assets/scss"
cp tests/fixtures/legacy-fonts/_variables_project.scss \
"$RUNNER_TEMP/oink-font-compat/assets/scss/_variables_project.scss"
hugo --source "$RUNNER_TEMP/oink-font-compat" \
--themesDir "$(dirname "$GITHUB_WORKSPACE")" \
--destination "$RUNNER_TEMP/oink-font-compat-public" \
--printPathWarnings --panicOnWarning
grep -R -q -- '--td-heading-font-family:Georgia, serif' \
"$RUNNER_TEMP/oink-font-compat-public/scss"
grep -R -q -- '--td-code-font-family:"Courier New", monospace' \
"$RUNNER_TEMP/oink-font-compat-public/scss"
grep -F -R -q -- \
'[data-td-typography=system]{--bs-font-monospace:"Legacy Mono", monospace' \
"$RUNNER_TEMP/oink-font-compat-public/scss"
if grep -R -q -- '--td-heading-font-family:var(--td-print-font-family)' \
"$RUNNER_TEMP/oink-font-compat-public/scss"; then
echo "print preset unexpectedly replaced the legacy heading font" >&2
exit 1
fi
- name: Reject an invalid typography preset
working-directory: exampleSite
run: |
if HUGO_PARAMS_UI_TYPOGRAPHY_PRESET=invalid \
hugo --destination "$RUNNER_TEMP/oink-invalid" \
>"$RUNNER_TEMP/oink-invalid.log" 2>&1; then
echo "invalid typography preset unexpectedly built" >&2
exit 1
fi
grep -q 'invalid params.ui.typography.preset' "$RUNNER_TEMP/oink-invalid.log"