Releases: tesar-tech/BlazorStatic
v1.0.0-beta10
XML sitemap and better way of finding pages
Breaking Changes
RazorPagesPaths
is no longer available. It was used to get the location of razor pages to scan for the@page
directive.
Now, BlazorStatic scans the assembly for all pages.AddNonParametrizedRazorPages
was renamed toAddPagesWithoutParameters
as it clearly describes what it is about.
Features/Improvements
- XML sitemap support is included in BlazorStatic.
- Improved page discovery: BlazorStatic automatically discovers all pages and adds them to
PagesToGenerate
.
Read more about it in our blog post.
PRs
- Better documentations by @MeltyObserver in #18
- Better docs by @tesar-tech in #19
- Better solution to register pages to generate as static files by @MeltyObserver in #20
- NonParametrized pages rename. by @tesar-tech in #22
- Generate xml Sitemap by @MeltyObserver in #21
Full Changelog: v1.0.0-beta.9...v1.0.0-beta10
v1.0.0-beta.9
Breaking Changes
BlogService
was renamed toBlazorStaticContentService
as it now serves a more general purpose.AddBlogService
was renamed toAddBlazorStaticContentService
. Use this in yourProgram.cs
.BlogOption
was renamed toBlazorStaticContentOptions
.FrontMatter
was renamed toBlogFrontMatter
as it is directly related to blog posts.IFrontMatter
is still available and can be used for any front matter of your choice.- The
UseBlog<TFrontMatter>
extension was made private and is now handled inUseBlazorStaticGenerator
. This makes your code one line shorter (removeUseBlog
from yourProgram.cs
).
Details
In this new version, we renamed Blog
related classes and variables to more general names. BlazorStatic is now used for more than just blogs. While the new names are slightly longer (BlogService
vs. BlazorStaticContentService
), they better capture the essence of what is happening. Additionally, app.UseBlog
is no longer necessary as it is now included in app.UseBlazorStaticGenerator
.
This is the result in your Program.cs
:
Before:
builder.Services
.AddBlogService<FrontMatter>()
.AddBlogService<ProjectFrontMatter>(opt => {
//...
});
//..
app.UseBlog<FrontMatter>();
app.UseBlog<ProjectFrontMatter>();
app.UseBlazorStaticGenerator(shutdownApp: !app.Environment.IsDevelopment());
Now:
builder.Services
.AddBlazorStaticContentService<BlogFrontMatter>()
.AddBlazorStaticContentService<ProjectFrontMatter>(opt => {
//...
});
//..
app.UseBlazorStaticGenerator(shutdownApp: !app.Environment.IsDevelopment());
PRs:
- Rename of BlogService to BlazorStaticContentService. by @tesar-tech and @MeltyObserver in #17
Full Changelog: v1.0.0-beta.8...v1.0.0-beta.9
v1.0.0-beta.8
Breaking changes
TwitterUserName
renamed toXUserName
, inFrontMatter
classes. When you change it, don't forget to also change the metadata in.md
files
What's Changed
- Feature/small updates by @tesar-tech in #15
- Fix/pipeline proj by @tesar-tech in #16
Full Changelog: v1.0.0-beta.7...v1.0.0-beta.8
v1.0.0-beta.7
Multiple changes arising from the discussion around this PR:
- Allow for multiple
IFrontMatter
implementations by @MeltyObserver in PR #13
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
Full Changelog: v1.0.0-beta.6...v1.0.0-beta.7
v1.0.0-beta.6
Breaking change
Post<TFrontMatter>.FilenameNoExtension
was renamed to simplerUrl
, It servers the same purpose but is more versatile now.
What's Changed
- Netlify Build Instructions by @IamRewt in #11
- search for posts in sub-directories by @MeltyObserver in #12
New Contributors
Full Changelog: v1.0.0-beta.5...v1.0.0-beta.6
v1.0.0-beta.5
What's Changed
- badge update by @tesar-tech in #8
- Update project dependencies and remove redundant ones by @MeltyObserver in #9
- Use the Posts found in './bin' instead of the root directory by @MeltyObserver in #10
New Contributors
- @MeltyObserver made their first contribution in #9
Full Changelog: https://github.com/tesar-tech/BlazorStatic/commits/v1.0.0-beta.5
v1.0.0-beta.4
Breaking change
- Use
builder.WebHost.UseStaticWebAssets();
to ensure static assets are copied to the output folder. See this for more info.
What's Changed
- Static web assets are always copied
IsDraft
property in defaultFrontMatter
is now supported- Ignoring files for the file generation works
See the blog post for more details.
New Contributors
Full Changelog: https://github.com/tesar-tech/BlazorStatic/commits/v1.0.0-beta.4?since=2023-12-27&until=2024-01-21