SyntaxCircus.Blazor.Seo
0.1.2
See the version list below for details.
dotnet add package SyntaxCircus.Blazor.Seo --version 0.1.2
NuGet\Install-Package SyntaxCircus.Blazor.Seo -Version 0.1.2
<PackageReference Include="SyntaxCircus.Blazor.Seo" Version="0.1.2" />
<PackageVersion Include="SyntaxCircus.Blazor.Seo" Version="0.1.2" />
<PackageReference Include="SyntaxCircus.Blazor.Seo" />
paket add SyntaxCircus.Blazor.Seo --version 0.1.2
#r "nuget: SyntaxCircus.Blazor.Seo, 0.1.2"
#:package SyntaxCircus.Blazor.Seo@0.1.2
#addin nuget:?package=SyntaxCircus.Blazor.Seo&version=0.1.2
#tool nuget:?package=SyntaxCircus.Blazor.Seo&version=0.1.2
SyntaxCircus.Blazor.Seo
SEO building blocks for Blazor Server marketing sites — meta/OG/Twitter tags, typed Schema.org JSON-LD, a canonical URL builder, a generic sitemap.xml/robots.txt endpoint, and canonical-host redirect middleware.
No support guaranteed. Published as-is and maintained on a best-effort basis. Issues and PRs are welcome, but there's no SLA — fork it or vendor what you need if that's not enough.
Setup
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSyntaxCircusSeo(builder.Configuration); // binds "Seo" and "Support"
var app = builder.Build();
app.UseCanonicalHost(); // optional — 301s non-canonical hosts to Seo:BaseUrl's host
app.MapSitemap(
staticEntries:
[
new SitemapEntry(builder.Configuration["Seo:BaseUrl"] + "/", DateTime.UtcNow, "weekly", 1.0),
new SitemapEntry(builder.Configuration["Seo:BaseUrl"] + "/about", DateTime.UtcNow),
],
dynamicEntriesProvider: async (services, ct) =>
{
var catalog = services.GetRequiredService<IMyCatalogService>();
return catalog.GetEntries().Select(e => new SitemapEntry($"{baseUrl}/items/{e.Slug}", e.UpdatedAt)).ToArray();
});
app.MapRobotsTxt();
Configuration
| Section | Purpose |
|---|---|
Seo |
BaseUrl, SiteName, DefaultDescription, DefaultOgImage, DefaultLocale, TwitterHandle, LogoUrl, SameAs |
Support |
Optional site support/contact info — Email, IssueTrackerUrl, IssueTemplateUrl, OwnerContactUrl, OwnerDisplayName |
Per-page meta tags
<SeoHead Title="Pricing" Description="Plans and pricing." RelativeUrl="/pricing" />
<JsonLd Data="@(new OrganizationSchema(Name: "Acme", Url: "https://acme.example", Logo: "https://acme.example/logo.png"))" />
SeoHead fills in description, canonical link, robots directives, and Open Graph/Twitter tags from SeoOptions plus whatever you override per-page. JsonLd serializes any typed schema record from Schemas.cs (OrganizationSchema, WebSiteSchema, PersonSchema, CreativeWorkSchema, SoftwareApplicationSchema, BookSchema, BreadcrumbListSchema, FaqPageSchema) — or your own POCO — as a <script type="application/ld+json"> block. Use as many <JsonLd> instances on one page as you need.
Notes
MapSitemap/MapRobotsTxtdon't assume output caching is configured — if your app hasAddOutputCache()/UseOutputCache()set up, chain.CacheOutput(...)onto the returned endpoint builder yourself.ISeoUrlBuilder(injectable) resolves relative URLs againstSeo:BaseUrland can compute the canonical URL for the current request.
Contributing
Issues and pull requests are welcome:
- Keep changes focused, with a clear description of the behavior change.
- Match the existing code style (see
.editorconfig). - Call out any breaking changes to the public API in your PR description.
License
MIT — see LICENSE.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.