diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 963c82ff..f818a12a 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -198,29 +198,37 @@ jobs: return $versionParts } - [string] $documentationDirectoryPath = if ('${{ github.event_name }}' -ieq 'release' -or '${{ github.ref_name }}' -ieq 'dev') { '${{ github.ref_name }}' } else { 'dev/${{ github.ref_name }}' } - dotnet run ` - --project CodeMap.Documentation ` - --configuration Release ` - --no-build ` - -- ` - -OutputFilePath "./docs/$documentationDirectoryPath/index.html" - New-Item ` -Type Directory ` -Name docs ` - -ErrorAction SilentlyContinue + -ErrorAction SilentlyContinue ` + | Out-Null New-Item ` -Type Directory ` -Name _data ` -Path docs ` - -ErrorAction SilentlyContinue + -ErrorAction SilentlyContinue ` + | Out-Null + + [string] $documentationDirectoryPath = if ('${{ github.event_name }}' -ieq 'release' -or '${{ github.ref_name }}' -ieq 'dev') { '${{ github.ref_name }}' } else { 'dev/${{ github.ref_name }}' } + dotnet run ` + --project CodeMap.Documentation ` + --configuration Release ` + --no-build ` + -- ` + -OutputFilePath "./docs/$documentationDirectoryPath/index.html" if (Test-Path 'CodeMap.Documentation/GitHub Pages') { Copy-Item ` -Path 'CodeMap.Documentation/GitHub Pages/*' ` -Destination './docs' ` -Recurse + + if (('${{ github.ref_name }}' -ine 'dev') -and (Test-Path './docs/_posts')) { + Remove-Item ` + -Path './docs/_posts' ` + -Recurse + } } Sort-SemVerDescending ( diff --git a/CodeMap.Documentation/GitHub Pages/_config.yml b/CodeMap.Documentation/GitHub Pages/_config.yml index 427c9a4a..c87df3d9 100644 --- a/CodeMap.Documentation/GitHub Pages/_config.yml +++ b/CodeMap.Documentation/GitHub Pages/_config.yml @@ -1,3 +1,10 @@ +paginate: 10 +paginate_path: /posts/page/:num/ +permalink: /posts/:categories/:year/:month/:day/:title/index:output_ext defaults: - values: - layout: bootstrap_5.2.3 \ No newline at end of file + layout: bootstrap_5.2.3 + - scope: + type: posts + values: + layout: post diff --git a/CodeMap.Documentation/GitHub Pages/_layouts/bootstrap_5.2.3.html b/CodeMap.Documentation/GitHub Pages/_layouts/bootstrap_5.2.3.html index 0bf93de1..42ee9d0b 100644 --- a/CodeMap.Documentation/GitHub Pages/_layouts/bootstrap_5.2.3.html +++ b/CodeMap.Documentation/GitHub Pages/_layouts/bootstrap_5.2.3.html @@ -21,6 +21,22 @@