From f332d04b00bb87b133caeb923ca9efb29d579460 Mon Sep 17 00:00:00 2001 From: Andrei Fangli Date: Tue, 4 Jul 2023 00:27:15 +0300 Subject: [PATCH] Added Posts (#47) --- .github/workflows/build-and-deploy.yml | 28 ++++--- .../GitHub Pages/_config.yml | 9 ++- .../_layouts/bootstrap_5.2.3.html | 32 ++++++-- .../GitHub Pages/_layouts/post.html | 25 ++++++ .../GitHub Pages/posts/index.html | 80 +++++++++++++++++++ 5 files changed, 156 insertions(+), 18 deletions(-) create mode 100644 CodeMap.Documentation/GitHub Pages/_layouts/post.html create mode 100644 CodeMap.Documentation/GitHub Pages/posts/index.html 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 @@