- Published on
Release of 1.0.0-beta.7
- Authors
- Name
- Jan Tesař
Breaking Changes
- The
BeforeFilesGenerationAction
property inBlazorStaticOptions
has been removed. UseBlazorStaticOptions.AddBeforeFilesGenerationAction
instead. This change is due to internal handling of blog post parsing. Blog post parsing no longer has a special property (BlogAction
) and is now handled byAddBeforeFilesGenerationAction
. - Blog posts are now parsed after the custom
beforeFilesGenerationAction
(which can be added viaopt.AddBeforeFilesGenerationAction
). This change should have no significant effect.
New Features
Multiple
BlogServices
can now be used, which is valuable when you have multiple "sections" with different FrontMatter classes. In BlazorStaticWebsite, a new projects section was created to demonstrate this usage. SeeProgram.cs
andProjectFrontMatter
.builder.Services.AddBlogService<FrontMatter>(opt => { }).AddBlogService<ProjectFrontMatter>(opt => { opt.MediaFolderRelativeToContentPath = null; opt.ContentPath = Path.Combine("Content", "Projects"); opt.AddTagPagesFromPosts = false; opt.BlogPageUrl = "projects"; });
This feature revealed a few refactorings (including the breaking changes) that have been done in this new version. It also highlighted that the name
BlogService
isn't quite precise. We will work on that.You can now define the blog media path as
null
, which will remove all warnings and errors related to a non-existent folder.builder.Services.AddBlogService<ProjectFrontMatter>(opt => { opt.MediaFolderRelativeToContentPath = null; });
Fixes
The program will no longer fail when the media path doesn't exist. It will issue a warning instead.
warn: BlazorStatic.Services.BlogService[0] The folder for the media path (C:\FullPath\BlazorStatic\BlazorStaticWebsite\Content\Projects\media) doesn't exist