|
2 | 2 |
|
3 | 3 | <# |
4 | 4 | .SYNOPSIS |
5 | | - Builds the Zensical site and normalizes output to the expected _site path. |
| 5 | + Builds the Zensical site under the framework artifact directory. |
6 | 6 |
|
7 | 7 | .DESCRIPTION |
8 | | - Runs zensical build from outputs/site and moves the generated _site directory |
9 | | - to <WorkingDirectory>/_site for downstream workflow steps. |
| 8 | + Runs zensical build from .PSModule/site. The generated site remains at |
| 9 | + <WorkingDirectory>/.PSModule/site/_site for downstream workflow steps. |
10 | 10 |
|
11 | 11 | .EXAMPLE |
12 | 12 | ./main.ps1 -WorkingDirectory '.' |
|
19 | 19 | #> |
20 | 20 | [CmdletBinding()] |
21 | 21 | param( |
22 | | - # Build working directory containing outputs/site and destination _site. |
| 22 | + # Build working directory containing the Zensical project and output. |
23 | 23 | [Parameter(Mandatory)] |
24 | 24 | [string]$WorkingDirectory |
25 | 25 | ) |
26 | 26 |
|
27 | 27 | $ErrorActionPreference = 'Stop' |
28 | 28 |
|
29 | 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' |
| 30 | +$siteWorkingDirectory = Join-Path -Path $resolvedWorkingDirectory -ChildPath '.PSModule/site' |
| 31 | +$outputSitePath = Join-Path -Path $siteWorkingDirectory -ChildPath '_site' |
32 | 32 |
|
33 | 33 | Set-Location -Path $siteWorkingDirectory |
34 | 34 |
|
35 | 35 | if (-not (Test-Path -Path 'zensical.toml')) { |
36 | | - throw "No documentation config file found in outputs/site. Expected zensical.toml." |
| 36 | + throw "No documentation config file found in .PSModule/site. Expected zensical.toml." |
37 | 37 | } |
38 | 38 |
|
39 | 39 | zensical build --config-file 'zensical.toml' |
40 | 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 | 41 | if (-not (Test-Path -Path $outputSitePath)) { |
49 | 42 | throw "Expected Zensical output at $outputSitePath but it was not created." |
50 | 43 | } |
0 commit comments