Skip to content

Commit fb1bdb8

Browse files
⚙️ [Maintenance]: Minor docs-site switch to Zensical (#403)
This PR finalizes the documentation pipeline as a clean-cut Zensical implementation and removes legacy Material/MkDocs fallback behavior. - Fixes #337 ## Changed: Build-Site now runs as Zensical-only `Build-Site` resolves site configuration from `zensical.toml` and no longer uses MkDocs compatibility paths. ## Changed: Workflow logic moved to internal actions Multi-line workflow scripts were extracted into internal composite actions with script files in `src/` so workflow behavior stays code-backed and toolable. ## Changed: Shared site script injection is centralized Navigation-state behavior is injected from framework-owned script files, replacing repo-local inline payload patterns. ## Technical Details - Added/updated internal actions for install, site structuring, build, and script injection. - Added framework-level site injector scripts under `.github/scripts/site-injectors/`. - Updated workflow/action definitions to remove long inline script blocks. - Added comment-based help and parameter documentation to newly introduced PowerShell entry scripts. ## Validation - Linter checks pass, including `GITHUB_ACTIONS_ZIZMOR`, `BIOME_LINT`, and `JAVASCRIPT_PRETTIER`. - Workflow test matrix passes for default and manifest scenarios. - Downstream verification was completed in `MariusStorhaug/MariusTestModule` with a merged follow-up (`#56`) and successful PR/main workflow runs. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 0307c0d commit fb1bdb8

34 files changed

Lines changed: 838 additions & 286 deletions

File tree

.github/actions/Build-PSModule/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ runs:
4040
PSMODULE_BUILD_PSMODULE_INPUT_OutputFolder: ${{ inputs.OutputFolder }}
4141
PSMODULE_BUILD_PSMODULE_INPUT_Version: ${{ inputs.Version }}
4242
PSMODULE_BUILD_PSMODULE_INPUT_Prerelease: ${{ inputs.Prerelease }}
43-
run: |
44-
# Build-PSModule
45-
${{ github.action_path }}/src/main.ps1
43+
run: ${{ github.action_path }}/src/main.ps1
4644

4745
- name: Upload module artifact
4846
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Build-ZensicalSite
2+
3+
Builds Zensical documentation site output and normalizes it to `<working-directory>/_site`.
4+
5+
## Inputs
6+
7+
- `WorkingDirectory` (required): Build working directory.
8+
9+
## Usage
10+
11+
```yaml
12+
- name: Build documentation site with Zensical
13+
uses: ./_wf/.github/actions/Build-ZensicalSite
14+
with:
15+
WorkingDirectory: .
16+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build-ZensicalSite
2+
description: Build Zensical site output and normalize output folder.
3+
4+
inputs:
5+
WorkingDirectory:
6+
description: Working directory for the repository build.
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Build documentation site
13+
shell: pwsh
14+
env:
15+
INPUT_WORKING_DIRECTORY: ${{ inputs.WorkingDirectory }}
16+
run: '& "${{ github.action_path }}/src/main.ps1" -WorkingDirectory "$env:INPUT_WORKING_DIRECTORY"'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
param(
2+
[Parameter(Mandatory)]
3+
[string]$WorkingDirectory
4+
)
5+
6+
$ErrorActionPreference = 'Stop'
7+
8+
$resolvedWorkingDirectory = Resolve-Path -Path $WorkingDirectory | Select-Object -ExpandProperty Path
9+
$siteWorkingDirectory = Join-Path -Path $resolvedWorkingDirectory -ChildPath 'outputs/site'
10+
$outputSitePath = Join-Path -Path $resolvedWorkingDirectory -ChildPath '_site'
11+
12+
Set-Location -Path $siteWorkingDirectory
13+
14+
if (-not (Test-Path -Path 'zensical.toml')) {
15+
throw "No documentation config file found in outputs/site. Expected zensical.toml."
16+
}
17+
18+
zensical build --config-file 'zensical.toml'
19+
20+
if (Test-Path -Path '_site') {
21+
if (Test-Path -Path $outputSitePath) {
22+
Remove-Item -Path $outputSitePath -Recurse -Force
23+
}
24+
Move-Item -Path '_site' -Destination $outputSitePath -Force
25+
}
26+
27+
if (-not (Test-Path -Path $outputSitePath)) {
28+
throw "Expected Zensical output at $outputSitePath but it was not created."
29+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#Requires -Version 7.0
2+
3+
<#
4+
.SYNOPSIS
5+
Builds the Zensical site and normalizes output to the expected _site path.
6+
7+
.DESCRIPTION
8+
Runs zensical build from outputs/site and moves the generated _site directory
9+
to <WorkingDirectory>/_site for downstream workflow steps.
10+
11+
.EXAMPLE
12+
./main.ps1 -WorkingDirectory '.'
13+
14+
.INPUTS
15+
None.
16+
17+
.OUTPUTS
18+
None.
19+
#>
20+
[CmdletBinding()]
21+
param(
22+
# Build working directory containing outputs/site and destination _site.
23+
[Parameter(Mandatory)]
24+
[string]$WorkingDirectory
25+
)
26+
27+
$ErrorActionPreference = 'Stop'
28+
29+
$resolvedWorkingDirectory = Resolve-Path -Path $WorkingDirectory | Select-Object -ExpandProperty Path
30+
$siteWorkingDirectory = Join-Path -Path $resolvedWorkingDirectory -ChildPath 'outputs/site'
31+
$outputSitePath = Join-Path -Path $resolvedWorkingDirectory -ChildPath '_site'
32+
33+
Set-Location -Path $siteWorkingDirectory
34+
35+
if (-not (Test-Path -Path 'zensical.toml')) {
36+
throw "No documentation config file found in outputs/site. Expected zensical.toml."
37+
}
38+
39+
zensical build --config-file 'zensical.toml'
40+
41+
if (Test-Path -Path '_site') {
42+
if (Test-Path -Path $outputSitePath) {
43+
Remove-Item -Path $outputSitePath -Recurse -Force
44+
}
45+
Move-Item -Path '_site' -Destination $outputSitePath -Force
46+
}
47+
48+
if (-not (Test-Path -Path $outputSitePath)) {
49+
throw "Expected Zensical output at $outputSitePath but it was not created."
50+
}

.github/actions/Cleanup-PSModulePrereleases/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@ runs:
2929
env:
3030
PSMODULE_CLEANUP_PSMODULEPRERELEASES_INPUT_WhatIf: ${{ inputs.WhatIf }}
3131
PSMODULE_CLEANUP_PSMODULEPRERELEASES_CONTEXT_ReleaseTag: ${{ env.PSMODULE_PUBLISH_PSMODULE_CONTEXT_ReleaseTag }}
32-
run: |
33-
# Cleanup prerelease tags
34-
${{ github.action_path }}/src/cleanup.ps1
32+
run: ${{ github.action_path }}/src/cleanup.ps1

.github/actions/Cleanup-PSModulePrereleases/src/cleanup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ param()
33

44
$PSStyle.OutputRendering = 'Ansi'
55

6-
Import-Module -Name 'Helpers' -Force
6+
Import-Module -Name 'PSModule' -Force
77

88
#region Load inputs
99
LogGroup 'Load inputs' {

.github/actions/Document-PSModule/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,4 @@ runs:
2727
DOCUMENT_PSMODULE_INPUT_Name: ${{ inputs.Name }}
2828
DOCUMENT_PSMODULE_INPUT_ShowSummaryOnSuccess: ${{ inputs.ShowSummaryOnSuccess }}
2929
working-directory: ${{ inputs.WorkingDirectory }}
30-
run: |
31-
# Build-PSModuleDocumentation
32-
${{ github.action_path }}/src/main.ps1
30+
run: ${{ github.action_path }}/src/main.ps1

.github/actions/Expose-TestData/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ runs:
2020
shell: pwsh
2121
env:
2222
PSMODULE_TEST_DATA: ${{ inputs.TestData }}
23-
run: |
24-
Import-TestData
23+
run: Import-TestData
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Inject-SiteScripts
2+
3+
Injects JavaScript snippets from `.github/scripts/site-injectors/*.js` into generated HTML files.
4+
5+
## Inputs
6+
7+
- `SitePath` (required): Path to generated site output.
8+
- `WorkflowPath` (optional, default `_wf`): Path where workflow repository is checked out.
9+
10+
## Usage
11+
12+
```yaml
13+
- name: Inject shared site scripts
14+
uses: ./_wf/.github/actions/Inject-SiteScripts
15+
with:
16+
SitePath: ./_site
17+
WorkflowPath: _wf
18+
```

0 commit comments

Comments
 (0)