Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
d883340
Testing testing
Andrei15193 Jun 18, 2023
d7741a8
Updated actions for testing
Andrei15193 Jun 18, 2023
514c5be
Testing with front matter
Andrei15193 Jun 18, 2023
19393d4
Added file extension
Andrei15193 Jun 18, 2023
cc37377
Added front matter
Andrei15193 Jun 18, 2023
1f455fa
Renamed post file name
Andrei15193 Jun 18, 2023
cf3aecc
Testing without front matter
Andrei15193 Jun 18, 2023
20aeddf
Added page title
Andrei15193 Jun 18, 2023
537a8e2
Updated the first post, umm... post
Andrei15193 Jun 18, 2023
78cdb22
Updated page title check
Andrei15193 Jun 18, 2023
4b6fe60
Added check for footer ref navigation
Andrei15193 Jun 18, 2023
f687a75
Fixed title check (#2)
Andrei15193 Jun 18, 2023
a0e0f92
This is getting tiring...
Andrei15193 Jun 18, 2023
9b84a89
Oh boy...
Andrei15193 Jun 18, 2023
a890af4
Fixed blog post title (for real this time)
Andrei15193 Jun 18, 2023
a4b6290
Cleanup, all good
Andrei15193 Jun 18, 2023
ef7c344
Added blog index page
Andrei15193 Jul 2, 2023
2b7a2d2
Update _config.yml
Andrei15193 Jul 2, 2023
6a416bf
Create 2023-06-19-Second-Post.md
Andrei15193 Jul 2, 2023
5442707
Create 2023-06-20-Third-Post.md
Andrei15193 Jul 2, 2023
96ac5d3
Create 2023-06-21-Fourth-Post.md
Andrei15193 Jul 2, 2023
eb1de33
Create 2023-06-22-Fifth-Post.md
Andrei15193 Jul 2, 2023
fbc303e
Create 2023-06-23-Sixth-Post.md
Andrei15193 Jul 2, 2023
21fdc08
Update _config.yml
Andrei15193 Jul 2, 2023
b2c9a76
Update index.html
Andrei15193 Jul 2, 2023
14eb621
Update _config.yml
Andrei15193 Jul 2, 2023
82952a1
Update _config.yml
Andrei15193 Jul 2, 2023
4d35ac2
Update bootstrap_5.2.3.html
Andrei15193 Jul 2, 2023
86c1adc
Update index.html
Andrei15193 Jul 2, 2023
bde5751
Update index.html
Andrei15193 Jul 2, 2023
2cfe3ff
Update index.html
Andrei15193 Jul 2, 2023
4b74377
Update _config.yml
Andrei15193 Jul 2, 2023
21f5d29
Update index.html
Andrei15193 Jul 2, 2023
9c9fd94
Update index.html
Andrei15193 Jul 2, 2023
b8f7586
Update index.html
Andrei15193 Jul 2, 2023
6207b55
Update index.html
Andrei15193 Jul 2, 2023
85e56d4
Update index.html
Andrei15193 Jul 2, 2023
86f5975
Update index.html
Andrei15193 Jul 2, 2023
610afa5
Update index.html
Andrei15193 Jul 2, 2023
0f05fe1
Update index.html
Andrei15193 Jul 2, 2023
7ef62af
Update index.html
Andrei15193 Jul 2, 2023
0422693
Update bootstrap_5.2.3.html
Andrei15193 Jul 2, 2023
229393b
Create post.html
Andrei15193 Jul 2, 2023
f093dec
Update _config.yml
Andrei15193 Jul 2, 2023
68fd8cf
Update _config.yml
Andrei15193 Jul 2, 2023
1f5fb3b
Update and rename 2023-06-18-First-Post.md to 2023-07-02-First-Post.md
Andrei15193 Jul 2, 2023
1f6d1e6
Rename index.html to index.html
Andrei15193 Jul 2, 2023
5e6ed0c
Update _config.yml
Andrei15193 Jul 2, 2023
0ec1999
Update index.html
Andrei15193 Jul 3, 2023
06a9661
Update post.html
Andrei15193 Jul 3, 2023
9257277
Update post.html
Andrei15193 Jul 3, 2023
1c0f24a
Update post.html
Andrei15193 Jul 3, 2023
063e0fb
Update post.html
Andrei15193 Jul 3, 2023
003b219
Update index.html
Andrei15193 Jul 3, 2023
24b4a97
Update 2023-07-02-First-Post.md
Andrei15193 Jul 3, 2023
0474191
Update index.html
Andrei15193 Jul 3, 2023
9b9e2f6
Update post.html
Andrei15193 Jul 3, 2023
15d1fda
Update post.html
Andrei15193 Jul 3, 2023
56cf139
Update index.html
Andrei15193 Jul 3, 2023
f1f03a3
Update post.html
Andrei15193 Jul 3, 2023
e025204
Update _config.yml
Andrei15193 Jul 3, 2023
65f154f
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
5d385ca
Update post.html
Andrei15193 Jul 3, 2023
6d1ad75
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
8a4f85a
Create 2023-07-03-Test-Post.md
Andrei15193 Jul 3, 2023
b41b902
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
96e0f79
Update post.html
Andrei15193 Jul 3, 2023
60a0dbb
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
91a7cff
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
462402c
Create 2023-07-02-Test-Post-2.md
Andrei15193 Jul 3, 2023
95d18eb
Update bootstrap_5.2.3.html
Andrei15193 Jul 3, 2023
345bcf1
Update index.html
Andrei15193 Jul 3, 2023
02cff05
Update bootstrap_5.2.3.html
Andrei15193 Jul 3, 2023
58262f0
Update index.html
Andrei15193 Jul 3, 2023
334ec2e
Update bootstrap_5.2.3.html
Andrei15193 Jul 3, 2023
424ab33
Cleanup
Andrei15193 Jul 3, 2023
0064446
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
54c1ff1
Update _config.yml
Andrei15193 Jul 3, 2023
cd2b093
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
0c27d16
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
b986dcc
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
cfac6a4
Update build-and-deploy.yml
Andrei15193 Jul 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
9 changes: 8 additions & 1 deletion CodeMap.Documentation/GitHub Pages/_config.yml
Original file line number Diff line number Diff line change
@@ -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
layout: bootstrap_5.2.3
- scope:
type: posts
values:
layout: post
32 changes: 25 additions & 7 deletions CodeMap.Documentation/GitHub Pages/_layouts/bootstrap_5.2.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto">
{% if site.posts.size > 0 %}
<li class="nav-item">
{% assign is_post_page = false %}
{% if page.path == 'posts/index.html' %}
{% assign is_post_page = true %}
{% else %}
{% for post in site.posts %}
{% if post == page %}
{% assign is_post_page = true %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
<a class="nav-link{% if is_post_page %} active{% endif %}" href="{{ 'posts' | relative_url }}">Posts</a>
</li>
{% endif %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle{% if page.version %} active{% endif %}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Documentation
Expand Down Expand Up @@ -58,17 +74,19 @@
</div>
</nav>

<div class="mt-2 mx-3 flex-fill">
<div class="mt-2 mx-3 d-flex flex-column flex-fill">
{{ content }}
</div>

<footer class="mt-2 px-3 py-2 border-top text-center">
{% if site.data.tags contains page.version %}
<a href="{{site.github.repository_url}}/releases/tag/{{ page.version }}">{{ site.github.repository_name }} {{ page.version }}</a>
{% else %}
<a href="{{site.github.repository_url}}/tree/{{ page.version }}">{{ site.github.repository_name }}@{{ page.version }}</a>
{% endif %}
{% if page.version %}
{% if site.data.tags contains page.version %}
<a href="{{site.github.repository_url}}/releases/tag/{{ page.version }}">{{ site.github.repository_name }} {{ page.version }}</a>
{% else %}
<a href="{{site.github.repository_url}}/tree/{{ page.version }}">{{ site.github.repository_name }}@{{ page.version }}</a>
{% endif %}
-
{% endif %}
<a href="{{site.github.repository_url}}">View on GitHub</a>
-
{% if site.data.tags contains page.version %}
Expand All @@ -80,4 +98,4 @@

<script src="{{ 'assets/bootstrap/5.2.3/bootstrap.bundle.min.js' | relative_url }}"></script>
</body>
</html>
</html>
25 changes: 25 additions & 0 deletions CodeMap.Documentation/GitHub Pages/_layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: bootstrap_5.2.3
---
{% assign post_index = 0 %}
{% for post in site.posts %}
{% if post == page %}
{% assign post_index = forloop.index0 %}
{% break %}
{% endif %}
{% endfor %}
{% assign post_page_number = post_index | divided_by: site.paginate | plus: 1 %}

<h1 class="mb-0">{{ page.title }} | <small><a href="{% if post_page_number == 1 %}{{ '/posts' | relative_url }}{% else %}{{ '/posts/page/' | append: post_page_number | relative_url }}{% endif %}">back</a></small></h1>
<p class="{% if page.tags.size > 0 %}mb-0 {% endif %}fst-italic fw-light"><small>Posted on {{ page.date | date: '%A, %-d %B %Y' }}</small></p>
{% if page.tags.size > 0 %}
<p>
<small>
{% for tag in page.tags %}
<span class="badge text-bg-primary">{{ tag }}</span>
{% endfor %}
</small>
</p>
{% endif %}

{{ content }}
80 changes: 80 additions & 0 deletions CodeMap.Documentation/GitHub Pages/posts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: CodeMap - Posts
---
<h1 class="mb-4">CodeMap Posts</h1>

<div class="flex-fill">
{% for post in paginator.posts %}
{% unless forloop.first %}<hr>{% endunless %}
{% assign post_url_index_length = '/index.html' | size %}
{% assign post_url_length = post.url | size | minus: post_url_index_length %}
{% assign post_url = post.url | slice: 0, post_url_length %}
<h3 class="mb-0"><a href="{{ post_url | relative_url }}">{{ post.title }}</a></h3>
<p class="{% if post.tags.size > 0 %}mb-0 {% endif %}fst-italic fw-light"><small>Posted on {{ post.date | date: '%A, %-d %B %Y' }}</small></p>
{% if post.tags.size > 0 %}
<p>
<small>
{% for tag in post.tags %}
<span class="badge text-bg-primary">{{ tag }}</span>
{% endfor %}
</small>
</p>
{% endif %}
{{ post.excerpt }}
{% endfor %}
</div>

<nav>
<ul class="mt-3 pagination pagination-sm justify-content-center">
{% assign page_offset_range = (0..4) %}
{% assign page_offset_previous = page_offset_range | size | divided_by: 2 %}

{% if paginator.page == 1 %}
<li class="page-item disabled">
<span class="page-link">First</span>
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="{{ '/posts' | relative_url }}">First</a>
</li>
{% endif %}

{% for page_offset in page_offset_range %}
{% assign page = paginator.page | plus: page_offset | minus: page_offset_previous %}

{% if forloop.first and page > 1 %}
<li class="page-item disabled">
<span class="page-link">...</span>
</li>
{% endif %}

{% if 1 <= page and page <= paginator.total_pages %}
{% if page == paginator.page %}
<li class="page-item active">
<span class="page-link">{{ page }}</span>
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="{% if page == 1 %}{{ '/posts' | relative_url }}{% else %}{{ '/posts/page/' | append: page | relative_url }}{% endif %}">{{ page }}</a>
</li>
{% endif %}
{% endif %}

{% if forloop.last and page < paginator.total_pages %}
<li class="page-item disabled">
<span class="page-link">...</span>
</li>
{% endif %}
{% endfor %}

{% if paginator.page == paginator.total_pages %}
<li class="page-item disabled">
<span class="page-link">Last</span>
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="{% if paginator.total_pages == 1 %}{{ '/posts' | relative_url }}{% else %}{{ '/posts/page/' | append: paginator.total_pages | relative_url }}{% endif %}">Last</a>
</li>
{% endif %}
</ul>
</nav>