GitHub CMS for Blazor: Getting Started

Set up a GitHub-backed content repository for your Blazor site with frontmatter, localization, and SSR-first rendering.

GitHub CMS for Blazor: Getting Started

GitHub CMS for Blazor: Getting Started

Learn how to structure your content repo, write frontmatter, and connect your Blazor app.

Repository structure

content/
??? en/
?   ??? blog/
?   ??? docs/
?   ??? pages/
??? fr/
    ??? ...

Frontmatter template

---
title: "Page Title"
author: "Author Name"
date: "2025-01-25"
description: "Short SEO description."
slug: "page-title"
categories: [Docs]
tags: [Blazor, CMS]
featured_image: "/images/feature.jpg"
seo_properties:
  title: "SEO Title"
  description: "SEO Description"
  og_image_url: "/images/social.jpg"
  type: "Article"
---

App configuration

builder.Services.AddOsirionContent(c => c.AddGitHub(o => {
  o.Owner = "username";
  o.Repository = "content-repo";
  o.ContentPath = "content";
  o.Branch = "main";
  o.UseCache = true;
}));

Rendering content

<ContentView Path="blog/my-post.md" />

Queries

<ContentList Directory="blog" Count="10" SortBy="SortField.Date" />

SEO & SSR

  • Use SeoMetadataRenderer with current content
  • Keep pages functional without JS; enhance progressively

Next steps

An unhandled error has occurred. Reload 🗙