logo
Published on

1.0.0-beta.13 - HotReload and `dotnet new` template

Authors
  • Name
    Jan Tesař

Breaking Changes

  • HotReload is now enabled by default. You can disable it with opt.HotReloadEnabled = false;.

  • Renamed some public methods and properties:

    • ParseAndAddBlogPosts -> ParseAndAddPosts
    • AfterBlogParsedAndAddedAction -> AfterContentParsedAndAddedAction

    Using the old methods will trigger warnings, but they still function by calling the new methods. These deprecated methods will be removed in an upcoming version.

HotReload

The previous version introduced HotReload, enhancing the development experience when building the site locally. With HotReload, every time you update your source code or .md file, BlazorStatic automatically refreshes the post list and regenerates all content. Learn more about HotReload here.

dotnet new template

Creating new sites just got easier! Install the new dotnet new templates with:

dotnet new install BlazorStatic.Templates

Then create your new BlazorStatic project:

dotnet new BlazorStaticMinimalBlog -o MyBlazorStaticApp

The template includes a GitHub action for easier publishing to GitHub Pages. If you plan to deploy elsewhere, see the deployment docs.

This was my first experience with the dotnet templating engine, and it exceeded my expectations. For example, have you ever wondered why the localhost port of your new dotnet app is always different? Here’s the explanation. BlazorStatic now supports similar functionality through the dotnet new template, as shown here.

The template is actually the BlazorStaticMinimalBlog repo, which you can "Use as template" if you prefer a quick setup without needing a desktop IDE.

BlazorStaticMinimalBlog is quite opinionated, featuring TailwindCSS and a layout I find readable. However, it doesn't have to be this way—many other templates can be created and used with BlazorStatic now. If you have any ideas, don't hesitate to share them.

HTML Images in Markdown Files

This feature wasn't supported before, but now it is:

I am **markdown**. Here is an image in HTML:

<img src="img.jpg"/>

Feedback

Try out the template and let me know if it meets your expectations or if you need any adjustments. Share your feedback by creating an issue or join the conversation in the Discord server.