Overview
The Blazor StaticDiscordNuget is a library that allows developers to transform their Blazor app into a static site generator. It leverages the capabilities of Blazor on .NET 8 to create static websites. The library provides methods for generating static HTML files, automating the discovery of pages to generate, simplifying blog post generation from markdown files, and facilitating easy deployment to platforms like GitHub Pages, Azure Static Web Apps, and Netlify.
Features
- Generate Static HTML Files: The library generates static HTML files by running the Blazor app and fetching page HTML with HttpClient.
- Automate Page Discovery: BlazorStatic automates the discovery of pages to generate by scanning for the @page directive in Razor files. It targets only non-parametrized pages.
- Simplify Blog Post Generation: The library simplifies blog post generation from markdown files. It provides a FrontMatter class for parsing blog post metadata and allows for custom IFrontMatter implementations to suit different markdown formats.
- Copy Necessary Files: BlazorStatic facilitates copying necessary files to the output folder.
- Flexible CSS Frameworks and Themes: The library offers flexibility in CSS frameworks and themes. It uses TailwindCSS in the default theme but allows for customization. Contributions for design improvements are welcome.
- Easy Deployment: Developers can deploy the generated files to platforms like GitHub Pages, Azure Static Web Apps, and Netlify. There are sample pipelines and a deployment guide available to help with the deployment process.
Summary
Blazor StaticDiscordNuget is a library that allows developers to transform their Blazor app into a static site generator. It provides features such as generating static HTML files, automating page discovery, simplifying blog post generation from markdown files, and enabling easy deployment. The library offers flexibility in CSS frameworks and themes and is compatible with platforms like GitHub Pages, Azure Static Web Apps, and Netlify. Contributions are encouraged and appreciated.