Osirion.Blazor.Cms
2.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Osirion.Blazor.Cms --version 2.0.0
NuGet\Install-Package Osirion.Blazor.Cms -Version 2.0.0
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="Osirion.Blazor.Cms" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Osirion.Blazor.Cms" Version="2.0.0" />
<PackageReference Include="Osirion.Blazor.Cms" />
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 Osirion.Blazor.Cms --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Osirion.Blazor.Cms, 2.0.0"
#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=Osirion.Blazor.Cms&version=2.0.0
#tool nuget:?package=Osirion.Blazor.Cms&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Osirion.Blazor.Cms
Content management components for Blazor applications with multiple provider support.
Features
- Multiple Content Providers: GitHub and FileSystem implementations included
- Provider Pattern: Easily extend with custom providers
- Markdown Support: Built-in Markdown rendering with frontmatter
- SSR Compatible: Works with Server-Side Rendering and Static SSG
- Caching: Efficient content delivery with built-in caching
- Content Organization: Categories, tags, and directory-based navigation
- Search: Full-text content search capabilities
Installation
dotnet add package Osirion.Blazor.Cms
Usage
Quick Start
// In Program.cs
using Osirion.Blazor.Cms.Extensions;
builder.Services.AddOsirionContent(content => {
content.AddGitHub(options => {
options.Owner = "username";
options.Repository = "content-repo";
options.ContentPath = "content";
options.Branch = "main";
});
});
@using Osirion.Blazor.Cms.Components
<ContentList />
<ContentView Path="blog/my-post.md" />
<CategoriesList />
<TagCloud />
<SearchBox />
<DirectoryNavigation />
File System Provider
builder.Services.AddOsirionContent(content => {
content.AddFileSystem(options => {
options.BasePath = "wwwroot/content";
options.WatchForChanges = true;
});
});
Content Queries
@inject IContentProvider ContentProvider
@code {
private async Task LoadContentAsync()
{
// Get all content items
var allItems = await ContentProvider.GetAllItemsAsync();
// Get content by directory
var blogPosts = await ContentProvider.GetItemsByQueryAsync(new ContentQuery {
Directory = "blog"
});
// Get content by category
var tutorials = await ContentProvider.GetItemsByQueryAsync(new ContentQuery {
Category = "tutorials"
});
// Get content by tag
var blazorPosts = await ContentProvider.GetItemsByQueryAsync(new ContentQuery {
Tag = "blazor"
});
// Search content
var searchResults = await ContentProvider.GetItemsByQueryAsync(new ContentQuery {
SearchQuery = "blazor components"
});
// Get featured content
var featured = await ContentProvider.GetItemsByQueryAsync(new ContentQuery {
IsFeatured = true
});
// Sort content
var recentFirst = await ContentProvider.GetItemsByQueryAsync(new ContentQuery {
SortBy = SortField.Date,
SortDirection = SortDirection.Descending
});
}
}
Markdown Frontmatter
---
title: "My Blog Post"
author: "John Doe"
date: "2025-04-20"
description: "A brief description of my post"
tags: [blazor, webassembly, dotnet]
categories: [tutorials, web]
slug: "my-blog-post"
is_featured: true
featured_image: "https://example.com/image.jpg"
---
# My Blog Post Content
Your markdown content here...
Creating Custom Providers
public class CustomProvider : ContentProviderBase
{
public CustomProvider(ILogger<CustomProvider> logger, IMemoryCache memoryCache)
: base(logger, memoryCache)
{
}
public override string ProviderId => "custom";
public override string DisplayName => "Custom Provider";
public override bool IsReadOnly => true;
public override Task<IReadOnlyList<ContentItem>> GetAllItemsAsync(CancellationToken cancellationToken = default)
{
// Your implementation
}
public override Task<ContentItem?> GetItemByPathAsync(string path, CancellationToken cancellationToken = default)
{
// Your implementation
}
public override Task<IReadOnlyList<ContentItem>> GetItemsByQueryAsync(ContentQuery query, CancellationToken cancellationToken = default)
{
// Your implementation
}
}
// Register the provider
builder.Services.AddOsirionContent(content => {
content.AddProvider<CustomProvider>();
});
Documentation
For more detailed documentation, see GitHub CMS Documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Markdig (>= 0.41.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Osirion.Blazor.Content (>= 2.0.0)
-
net9.0
- Markdig (>= 0.41.0)
- Microsoft.Extensions.Caching.Memory (>= 9.0.4)
- Microsoft.Extensions.Http (>= 9.0.4)
- Osirion.Blazor.Content (>= 2.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Osirion.Blazor.Cms:
Package | Downloads |
---|---|
Osirion.Blazor
Modern, high-performance Blazor components and utilities. Features SSR-compatible components for navigation, analytics, content management, and theming with seamless CSS framework integration. |
GitHub repositories
This package is not used by any popular GitHub repositories.