Razor in.
Plain HTML out.
Bevel adds static pages to the ASP.NET Core app you already know. You write Razor components and drop your content in Data/. Bevel builds plain HTML you can host anywhere.
Get started Follow the tutorial
dotnet new install Bevel.Templates
dotnet new bevel -n MySite
Razor components and Markdown data go in. Bevel runs at build time and writes plain HTML pages, like this schedule page, that you can host anywhere.
How it works
You keep your content in files. Bevel does the rest.
You add files
You put Markdown, JSON, YAML, or XML under
Data/. You describe each collection with a C# record.Bevel types them
At build time, Bevel reads every file and checks it. You get
ISiteDatawith one typed property per collection.You export plain HTML
You map Razor pages with
MapStatic. While you work, they render live. One command writes them as static files.
Start here
Pick the path that fits where you are.
You create a site and see it run in five minutes.
You build a conference site from empty folder to published pages.
You learn data, pages, and deployment one task at a time.
A peek at the code
Follow one talk from a Markdown file to a page. This is real code from the conference site you build in the tutorial.
You write the talk as Markdown. The front matter holds the facts. speakerId points at a speaker in another file.
---
title: "Keynote: Static First"
start: 2027-05-12T09:30:00
minutes: 45
room: "Main Hall"
speakerId: ada
summary: "Why the fastest page is the one you built yesterday."
---
Most pages do not change between requests. So why do we render them on every request?
Ada opens the conference with a tour of the **static-first** mindset:
- Turn your content into plain data.
- Render it once, at build time.
- Keep servers for the parts that really need them.
Expect live code, a few strong opinions, and a free tour of the schedule you are reading right now.
You describe a session once, as a C# record. Bevel checks every file against it at build time, and turns speakerId into a real Speaker.
[DataSource("Sessions", "./**/*.md", OrderBy = "Start")]
public sealed record Session(
[Unique(IgnoreCase = true)] string Slug,
string Title,
[GroupByDate("Days", GroupPeriod.Day, Format = "dddd, MMMM d")]
DateTime Start,
int Minutes,
string Room,
string Summary,
[Reference("Speakers")] Speaker Speaker,
string RawMarkdown)
{
public DateTime End => Start.AddMinutes(Minutes);
}
You write the talk's page as a Razor component. Bevel hands it one Session through the Session parameter. The speaker is already there, so Session.Speaker.Name just works.
@layout MainLayout
@inject ISiteData Data
@inject ISiteLinks Links
<SectionContent SectionName="head">
<title>@Session.Title — @Data.Site.Title</title>
<meta name="description" content="@Session.Summary"/>
</SectionContent>
<p class="crumb"><a href="@(Links.To<SchedulePage>())">← Schedule</a></p>
<p class="when">
@Session.Start.ToString("dddd, MMMM d") ·
@Session.Start.ToString("HH:mm") – @Session.End.ToString("HH:mm") ·
@Session.Room
</p>
<h1>@Session.Title</h1>
<p class="by">
with <a href="@Links.To(Session.Speaker)">@Session.Speaker.Name</a>, @Session.Speaker.Role
</p>
<Markdown Source="@Session.RawMarkdown"/>
@code {
[Parameter] [EditorRequired] public Session Session { get; set; } = default!;
}
One line gives every session its own page. Bevel renders SessionPage once per session and fills {Slug} from each one. Run the export, and each page becomes a plain HTML file.
// One page per item: {Slug} is filled from each session's Slug property.
app.MapStatic<SessionPage>("/sessions/{Slug}", (ISiteData data) => data.Sessions);
The schedule lists every talk with a small SessionCard component. Links.To(Session) links each card to the page from step 4, with no URL strings to keep in sync.
@inject ISiteLinks Links
<article class="session">
<p class="when">@Session.Start.ToString("HH:mm") – @Session.End.ToString("HH:mm") · @Session.Room</p>
<h3><a href="@Links.To(Session)">@Session.Title</a></h3>
<p class="by">
<a href="@Links.To(Session.Speaker)">@Session.Speaker.Name</a>
</p>
<p>@Session.Summary</p>
</article>
@code {
[Parameter] [EditorRequired] public Session Session { get; set; } = default!;
}