1. Create the site
Create an ASP.NET Core app, add Bevel, load a site settings file, and render a home page.
On this page
mkdir Bevel.Conference && cd Bevel.Conference
dotnet new web -n Bevel.Conference -f net10.0 -o .
dotnet add package Bevel
By the end of this step you have a home page that shows your conference name, date, city and tagline. All of it comes from a settings file.
Write the settings file
Bevel loads files under
Data/at build time. CreateData/Site/site.yaml:samples/Bevel.Conference/Data/Site/site.yamlyaml title: Bevel Conf 2027 tagline: Two days of static sites, written in C#. description: A fictional conference for .NET developers who like their sites fast, simple and built with Razor. city: Lisbon timeZone: Europe/LisbonDescribe it with a record
Create
Data/Site/SiteConfig.cs. The attribute names the dataset (Site) and points at the file. The path is relative to this.csfile:samples/Bevel.Conference/Data/Site/SiteConfig.cscsharp namespace Bevel.Conference.Data; [DataSource("Site", "./site.yaml")] public sealed record SiteConfig( string Title, string Tagline, string Description, string City, string TimeZone);When you build, Bevel generates
ISiteDatawith aSiteproperty of typeSiteConfig. The compiler now knows every setting you have.Add a layout
Create
Components/MainLayout.razor. It holds the<html>shell that every page shares:Components/MainLayout.razorrazor @inherits LayoutComponentBase @inject ISiteData Data @inject ISiteLinks Links <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="description" content="@Data.Site.Description"/> <link rel="stylesheet" href="@Links.Asset("/css/site.css")"/> <SectionOutlet SectionName="head"/> </head> <body> <header class="site-header"> <a class="brand" href="@(Links.To<HomePage>())">Bevel Conf <span>2027</span></a> </header> <main> @Body </main> <footer class="site-footer"> <p>@Data.Site.Title · @Data.Site.City · Made with <a href="https://github.com/khalidabuhakmeh/bevel">Bevel</a></p> </footer> </body> </html>Linksbuilds URLs.Links.Assetadds your path base to a file such as the stylesheet.Links.To<HomePage>()finds the URL of a page from its route.Add the imports
Create
_Imports.razorin the project root so every component sees the same namespaces:_Imports.razorrazor @using Microsoft.AspNetCore.Components @using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Sections @using Bevel @using Bevel.Conference @using Bevel.Conference.Data @using Bevel.Conference.Components @using Bevel.Conference.PagesAdd the styles
Copy
wwwroot/css/site.cssfrom the sample into yourwwwroot/css/folder. It is 51 lines of plain CSS. You do not need to read it.Write the home page
Create
Pages/HomePage.razor:Pages/HomePage.razorrazor @layout MainLayout @inject ISiteData Data <SectionContent SectionName="head"> <title>@Data.Site.Title</title> </SectionContent> <section class="hero"> <p class="eyebrow">May 12–13, 2027 · @Data.Site.City</p> <h1>@Data.Site.Title</h1> <p class="lead">@Data.Site.Tagline</p> </section>Map it
Replace
Program.cs.AddBevelturns Bevel on.MapStaticsays "this page lives at this URL":Program.cscsharp using Bevel.Conference.Pages; var builder = WebApplication.CreateBuilder(args); builder.AddBevel(); var app = builder.Build(); app.UseStaticFiles(); app.MapStatic<HomePage>("/"); app.Run();UseStaticFilesserves your stylesheet while you run the site live.
Run it
dotnet watch
Open the URL it prints. You should see the page below: the conference name, a tagline, and nothing else yet.

Change tagline in site.yaml and save. The page updates. That is the whole loop: edit a file, see a page.
Next: 2. Speakers from YAML.