FoxLearn.JsonLd.AspNetCore 1.0.3

dotnet add package FoxLearn.JsonLd.AspNetCore --version 1.0.3
                    
NuGet\Install-Package FoxLearn.JsonLd.AspNetCore -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FoxLearn.JsonLd.AspNetCore" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FoxLearn.JsonLd.AspNetCore" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="FoxLearn.JsonLd.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FoxLearn.JsonLd.AspNetCore --version 1.0.3
                    
#r "nuget: FoxLearn.JsonLd.AspNetCore, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=FoxLearn.JsonLd.AspNetCore&version=1.0.3
                    
Install FoxLearn.JsonLd.AspNetCore as a Cake Addin
#tool nuget:?package=FoxLearn.JsonLd.AspNetCore&version=1.0.3
                    
Install FoxLearn.JsonLd.AspNetCore as a Cake Tool

FoxLearn.JsonLd.AspNetCore

FoxLearn.JsonLd.AspNetCore is a lightweight .NET library that automatically inserts <script> tags with the MIME type application/ld+json into the <head> section of your HTML. It allows search engines to better understand the content of your web pages by adding structured data (JSON-LD), which can improve SEO and help search engines parse and display your content more accurately.


Features

  • Automatically injects structured data (JSON-LD)
  • Enhances SEO and search visibility
  • Easy integration with ASP.NET Core applications
  • Supports custom schema definitions using Schema.org formats
  • No manual HTML edits required

Installation

Install via the .NET CLI:

dotnet add package FoxLearn.JsonLd.AspNetCore

Or via the NuGet UI in Visual Studio by searching for FoxLearn.JsonLd.AspNetCore

Usage

Register the services in Startup.cs or Program.cs:

builder.Services.Configure<Schema.NET.Organization>(options =>
{
    options.Name = "FoxLearn";
    options.Url = new Uri("https://foxlearn.com");
    // Add other Schema.org properties here
});

builder.Services.AddScoped<IJsonLdBuilder, JsonLdBuilder>();

var app = builder.Build();
app.UseMiddleware<JsonLdMiddleware>();

Add structured data in your controller or view model:

private readonly IJsonLdBuilder _jsonLd;

public HomeController(IJsonLdBuilder jsonLd)
{
    _jsonLd = jsonLd;
}

public IActionResult Category(string categoryName)
{
    BreadcrumbList breadcrumbList = new()
    {
        Name = "Breadcrumb",
        ItemListElement = new List<IListItem>()
        {
            new ListItem { Position = 1, Name = "Home", Url = new Uri($"{Request.Scheme}://{Request.Host}") },
            new ListItem { Position = 2, Name = "Category", Url = new Uri($"{Request.Scheme}://{Request.Host}/{categoryName}") }
        }
    };

    _jsonLd.Add(breadcrumbList);
    return View();
}

Example Output

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "FoxLearn",
  "url": "https://foxlearn.com"
}
</script>

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 126 5/11/2025