Osirion.Blazor.Cms 2.0.0

There is a newer version of this package available.
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" />
                    
Directory.Packages.props
<PackageReference Include="Osirion.Blazor.Cms" />
                    
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 Osirion.Blazor.Cms --version 2.0.0
                    
#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
                    
Install Osirion.Blazor.Cms as a Cake Addin
#tool nuget:?package=Osirion.Blazor.Cms&version=2.0.0
                    
Install Osirion.Blazor.Cms as a Cake Tool

Osirion.Blazor.Cms

NuGet License

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 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.

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.

Version Downloads Last updated
2.1.4 34 6/18/2025
2.1.3 66 5/31/2025
2.1.2 72 5/31/2025
2.1.1 140 5/20/2025
2.1.0 143 5/19/2025
2.0.2 153 4/23/2025
2.0.1 163 4/23/2025
2.0.0 167 4/22/2025