Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
krompaco committed Sep 1, 2023
2 parents 4cd3171 + 15ac39d commit d117f7d
Show file tree
Hide file tree
Showing 118 changed files with 8,570 additions and 5,247 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"cSpell.words": [
"ASPNETCORE",
"hotwired",
"Krompaco",
"nwtgck",
"prodbuild",
"pwsh",
"tailwindcss",
"toggleable",
"wwwroot"
]
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /record-collector

COPY src/Krompaco.RecordCollector.Web/ src/Krompaco.RecordCollector.Web/
Expand All @@ -7,7 +7,7 @@ COPY src/Krompaco.RecordCollector.Generator/ src/Krompaco.RecordCollector.Genera
COPY .editorconfig .

# This is where you probably have your own content somewhere
COPY docs/content-record-collector-net/ docs/content-record-collector-net/
COPY content/demo-site/ docs/demo-site/

ENV ASPNETCORE_ENVIRONMENT Docker

Expand Down
6 changes: 3 additions & 3 deletions Krompaco.RecordCollector.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29905.134
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krompaco.RecordCollector.Web", "src\Krompaco.RecordCollector.Web\Krompaco.RecordCollector.Web.csproj", "{BA2495A2-09B5-4502-8847-417B4EFCE411}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krompaco.RecordCollector.Generator", "src\Krompaco.RecordCollector.Generator\Krompaco.RecordCollector.Generator.csproj", "{54DFEC5A-E007-40EE-AC17-8BFCB9C5961E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krompaco.RecordCollector.Content", "src\Krompaco.RecordCollector.Content\Krompaco.RecordCollector.Content.csproj", "{160D0157-17B7-447C-B05F-652C0DF095DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Krompaco.RecordCollector.Content.Tests", "tests\Krompaco.RecordCollector.Content.Tests\Krompaco.RecordCollector.Content.Tests.csproj", "{6E9AF449-342F-426F-9A4C-228FEC504150}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Krompaco.RecordCollector.Content.Tests", "tests\Krompaco.RecordCollector.Content.Tests\Krompaco.RecordCollector.Content.Tests.csproj", "{6E9AF449-342F-426F-9A4C-228FEC504150}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 2 additions & 0 deletions Krompaco.RecordCollector.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Hotwire/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Krompaco/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=listcategory/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Localizer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=simplecss/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=startpage/@EntryIndexedValue">True</s:Boolean>


Expand Down
51 changes: 35 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# record-collector.net
# Record Collector

The [Record Collector example and documentation web site](https://record-collector.net) is being filled with content and will have all the information on what the project is and does. Easiest starting point is to set up the repository locally and run the web project, see the [getting started](https://record-collector.net/en/pages/getting-started/) page for instructions.
Record Collector's offical web site is being filled with content and will have all the information on what the project is and does. Easiest starting point is to set up the repository locally and run the web project, see the [getting started](https://record-collector.net/pages/getting-started/) page for instructions.

## Inspiration

Expand All @@ -10,33 +10,52 @@ This project is heavily inspired by [Hugo](https://gohugo.io/) and I try to be s

The content file layer is converted to C# lists and objects and then used in a regular ASP.NET Core MVC project which is also where you can work _live_ on both content preview and templating. This means you now can use your existing ASP.NET MVC and C# skills creating static site templates!

In this setup the generation process work using the WebApplicationFactory from the Microsoft.AspNetCore.Mvc.Testing package so I don't have to fall back to a console application or custom web servers for crunching the files and templates which is the norm for static site generation. Feels a lot better to me and while keeping really fast generation times.
In this setup the generation process work using the WebApplicationFactory from the Microsoft.AspNetCore.Mvc.Testing package so I don't have to fall back to a console application or custom web servers for crunching the files and templates which seems to be the norm for static site generation. Feels good to me and generation times are still fast.

## Installed packages
## Open source references

Built using .NET 5.0 and these packages and projects. Thank you!
Built using .NET 6.0 (through 3.1 and 5.0) and with these packages and projects. Thank you!

| Project | License |
|---------------------------------------------------------|---------------------------|
| [YamlDotNet](https://github.com/aaubry/YamlDotNet/wiki) | MIT |
| [Tomlyn](https://github.com/xoofx/Tomlyn) | BSD-Clause 2 |
| [Markdig](https://github.com/lunet-io/markdig) | BSD-Clause 2 |
| [Inter font family](https://rsms.me/inter/) | SIL Open Font License 1.1 |
| Project | License |
|-----------------------------------------------------------|---------------------------|
| [YamlDotNet](https://github.com/aaubry/YamlDotNet/wiki) | MIT |
| [Tomlyn](https://github.com/xoofx/Tomlyn) | BSD-Clause 2 |
| [Markdig](https://github.com/lunet-io/markdig) | BSD-Clause 2 |
| [Tailwind CSS](https://tailwindcss.com/) | MIT |
| [Hotwire](https://hotwired.dev/) | MIT |
| [Simple.css](https://simplecss.org/) | MIT |
| [Html Agility Pack](https://html-agility-pack.net/) | MIT |

Other things such as Webpack can be involved too but these are the ones I reference directly.

### Quality control tools

* [StyleCop.Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)
* [Microsoft.CodeAnalysis.NetAnalyzers](https://github.com/dotnet/roslyn-analyzers)

### Demo sites

The [demo web site](https://record-collector.net) views are closed source and some parts use [Tailwind UI](https://tailwindui.com) which needs a purchased license. I will look into if the full demo site can be opened or made accessible in some form. The demo Website is generated and [deployed with Netlify using their build-image](https://github.com/krompaco/record-collector/blob/main/docs/content-record-collector-net/en/updates/continuous-deployment-using-just-netlify.md).
## [Official web site](https://record-collector.net)

[![Netlify Status](https://api.netlify.com/api/v1/badges/d83429cd-4060-466a-8491-1afbb1c97149/deploy-status)](https://app.netlify.com/sites/record-collector-ui/deploys)

The [sample web site](https://record-collector.netlify.app) is generated on push and [deployed to Netlify using a GitHub Action](https://github.com/krompaco/record-collector/blob/main/docs/content-record-collector-net/en/updates/deploy-to-netlify-using-a-github-action.md).
The official web site is generated and [deployed with Netlify using their build-image](https://github.com/krompaco/record-collector/blob/main/content/record-collector-dotnet/updates/continuous-deployment-using-just-netlify.md).

It has the `default` frontend.

## [Demo web site with Simple.css frontend](https://record-collector-simplecss.netlify.app)

[![Netlify Status](https://api.netlify.com/api/v1/badges/471c792b-b666-4bb4-aa60-270f22c98180/deploy-status)](https://app.netlify.com/sites/record-collector-simplecss/deploys)

The Simple.css demo web site is generated and deployed with Netlify using their build-image.

It has the `simplecss` frontend configuration.

## [Demo web site with default frontend](https://record-collector.netlify.app)

[![Build and deploy to Netlify](https://github.com/krompaco/record-collector/actions/workflows/build-and-deploy-to-netlify.yml/badge.svg)](https://github.com/krompaco/record-collector/actions/workflows/build-and-deploy-to-netlify.yml)

This site is generated on push and [deployed to Netlify using a GitHub Action](https://github.com/krompaco/record-collector/blob/main/content/record-collector-dotnet/updates/deploy-to-netlify-using-a-github-action.md).

[![Netlify Status](https://api.netlify.com/api/v1/badges/97fc0268-36e9-408f-995c-13ed2605a11e/deploy-status)](https://app.netlify.com/sites/record-collector/deploys)
It has the `default` frontend.

## License

Expand Down
17 changes: 17 additions & 0 deletions content/demo-site/_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
+++
title = "record-collector.net"
description = "The documentation and Record Collector demo web site."
note = "Should be the language selection page"
robots = "noindex"
+++
<p lang="en">A .NET 6.0 static site kit. Follow the <a href="https://github.com/krompaco/record-collector">repository on Github</a> and the <a href="https://krompaco.nu/">author's blog</a> to get updates on new features and more sample usage.</p>
<ul>
<li lang="en">
<h2><a href="/en/">The English site</a></h2>
<p>Learn about and see the framework in English.</p>
</li>
<li lang="sv">
<h2><a href="/sv/">Webbplatsen på svenska</a></h2>
<p>Läs om och se ramverket på svenska.</p>
</li>
</ul>
10 changes: 10 additions & 0 deletions content/demo-site/en/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
title = "The .NET 6.0 static site toolkit"
description = "The documentation and Record Collector demo web site."
keywords = "C# HTML"
+++
This site acts as a demo web site of the static output.

The [Github repo](https://github.com/krompaco/record-collector) has the framework code, templates and content that makes up this site.

Below is a latest posts list with _pagination_.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ title = "Category listing for examples category"
description = "Category or tag listing example page."
keywords = "C# HTML"
listcategory = "Examples"
robots = "noindex"
+++
Listing pages with "Examples" in their categories property.
7 changes: 7 additions & 0 deletions content/demo-site/en/pages/about/about-sub-page/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "Sub page to about"
description = "Description about page."
weight = 15
robots = "noindex"
+++
Example sub page.
8 changes: 8 additions & 0 deletions content/demo-site/en/pages/about/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
linkTitle = "About Record Collector"
title = "What does Record Collector do?"
description = "The main features and advantages when using Record Collector."
weight = 15
robots = "noindex"
+++
Record Collector reads a typical static site content folder into C# lists and objects and then uses them in a regular ASP.NET Core MVC project.
7 changes: 7 additions & 0 deletions content/demo-site/en/pages/about/sub-page-2/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "Sub page 2 to about"
description = "Description about page."
weight = 15
robots = "noindex"
+++
Example sub page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "Sub page 2 1 to about"
description = "Description about page."
weight = 15
robots = "noindex"
+++
Example sub page.
8 changes: 8 additions & 0 deletions content/demo-site/en/pages/getting-started/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
linkTitle = "Getting started"
title = "Getting started"
description = "To learn how Record Collector works it's easiest to grab a copy of the repository run it locally. Here are the steps."
weight = 10
robots = "noindex"
+++
To learn how Record Collector works it's easiest to grab a copy of the repository run it locally.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ robots: "noindex"

This content was found as part of the [Docsy example repo](https://github.com/google/docsy-example).
<!--more-->
Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.

There should be whitespace between paragraphs. Vape migas chillwave sriracha poutine try-hard distillery. Tattooed shabby chic small batch, pabst art party heirloom letterpress air plant pop-up. Sustainable chia skateboard art party banjo cardigan normcore affogato vexillologist quinoa meggings man bun master cleanse shoreditch readymade. Yuccie prism four dollar toast tbh cardigan iPhone, tumblr listicle live-edge VHS. Pug lyft normcore hot chicken biodiesel, actually keffiyeh thundercats photo booth pour-over twee fam food truck microdosing banh mi. Vice activated charcoal raclette unicorn live-edge post-ironic. Heirloom vexillologist coloring book, beard deep v letterpress echo park humblebrag tilde.

Expand Down Expand Up @@ -123,8 +123,6 @@ If a table is too wide, it should scroll horizontally.

Code snippets like `var foo = "bar";` can be shown inline.

Also, `this should vertically align` ~~`with this`~~ ~~and this~~.

Code can also be shown in a block element.

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@
<p>Actual HTML made this post.</p>
<!--more-->
<p>Actual HTML made this post. Actual HTML made this post. Actual HTML made this post.</p>

<h2>Heading level 2</h2>

<p>Testing to embed a video.</p>

<div class="iframe-wrapper">
<iframe title="YouTube video with Belton" src="https://www.youtube-nocookie.com/embed/W6jjNRUqPxg" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authorimage: "/files/jk.jpg"
robots: "noindex"
---

Text can be **bold**, _italic_, or ~~strikethrough~~.
Text can be **bold**, _italic_, or lorem ipsum.
<!--more-->
There should be whitespace between paragraphs and they can contain text that is long or short. This is sample content.

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 14 additions & 0 deletions content/demo-site/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[headers]]
for = "/*"
[headers.values]
Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload"
X-Frame-Options = "DENY"
X-XSS-Protection = "0"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "no-referrer"
Permissions-Policy = "accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), interest-cohort=(), hid=(), idle-detection=(), serial=()"
Content-Security-Policy = "default-src 'none'; base-uri 'self'; script-src 'self'; img-src 'self' cloudfront.net *.cloudfront.net api.netlify.com/api/v1/badges/; style-src 'self' 'unsafe-inline'; font-src 'self'; form-action 'none'; frame-src 'none'; connect-src 'self'; media-src 'self'; child-src 'self'; frame-ancestors 'none'; worker-src 'none'; manifest-src 'none';"
[[headers]]
for = "/dist/*"
[headers.values]
Cache-Control = "public, max-age=31536000"
11 changes: 11 additions & 0 deletions content/demo-site/sv/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
+++
title = "Verktygslådan för .NET 6.0 och HTML-generering"
description = "Exempel och dokumentation för Record Collector."
keywords = "C# HTML"
robots = "noindex"
+++
Den här webbplatsen innehåller dokumentation och är i sig en demo av en enkel webbplats byggd med Record Collector.

Se [Github-repot](https://github.com/krompaco/record-collector) för ramverkets kod, mallarna och innehållsfilerna som utgör den här webbplatsen.

Nedan följer ett exempel på en sidlistning med _paginering_.
8 changes: 8 additions & 0 deletions content/demo-site/sv/exempel/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Kategori-listning för \"Exempel\""
description = "Kategori-listning för \"Exempel\""
keywords = "C# HTML"
listcategory = "Exempel"
robots = "noindex"
+++
Listar sidor med "Exempel" satt som kategori.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ linkTitle = "Börja använda"
title = "Kom igång"
description = "Information om hur du kommer igång och anpassar Record Collector."
weight = 10
robots = "noindex"
+++
Instruktioner finns på den [den engelska "Getting started"-sidan](/en/pages/getting-started/).
Instruktioner finns på den [den engelska webbplatsen för Record Collector](https://record-collector.net/).
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ linkTitle = "Om Record Collector"
title = "Vad är Record Collector?"
description = "Information om vad Record Collector innehåller."
weight = 15
robots = "noindex"
+++
Så här fungerar Record Collector.

![Skiss på Record Collectors flöde](/files/flow.png)

Mer information hittar du på [den engelska About-sidan](/en/pages/about/).
Mer information finns på den [den engelska webbplatsen för Record Collector](https://record-collector.net/).
Loading

1 comment on commit d117f7d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.