5. A page per session and speaker
Map one route to a whole list and get a page for every session and speaker, with Markdown rendered by Markdig.
On this page
app.MapStatic<SessionPage>("/sessions/{Slug}", (ISiteData data) => data.Sessions);
app.MapStatic<SpeakerPage>("/speakers/{Id}", (ISiteData data) => data.Speakers);
Two lines make thirteen pages: eight sessions and five speakers. Bevel renders one page for each item in the list.
Map the routes
Add
using Bevel.Conference.Data;to the top ofProgram.cs, because the handlers ask forISiteData. Then add these routes after the schedule route:samples/Bevel.Conference/Program.cscsharp // One page per item: {Slug} is filled from each session's Slug property. app.MapStatic<SessionPage>("/sessions/{Slug}", (ISiteData data) => data.Sessions);samples/Bevel.Conference/Program.cscsharp app.MapStatic<SpeakerPage>("/speakers/{Id}", (ISiteData data) => data.Speakers);{Slug}is filled from each session'sSlugproperty.{Id}is filled from each speaker'sId. The page receives the item as a typed parameter.Render the Markdown
Bevel gives you the raw Markdown. You pick the renderer. Add Markdig:
bash dotnet add package MarkdigCreate
Components/Markdown.razor:samples/Bevel.Conference/Components/Markdown.razorrazor @using Markdig @((MarkupString)Html) @code { [Parameter] [EditorRequired] public string Source { get; set; } = ""; private string Html => Markdig.Markdown.ToHtml(Source); }Write the session page
Create
Pages/SessionPage.razor. This is the whole file. The@codeblock at the bottom is how the page receives its session:samples/Bevel.Conference/Pages/SessionPage.razorrazor @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!; }Write the speaker page
Create
Pages/SpeakerPage.razorthe same way. It receives aSpeakerinstead:samples/Bevel.Conference/Pages/SpeakerPage.razorrazor @layout MainLayout @inject ISiteData Data @inject ISiteLinks Links <SectionContent SectionName="head"> <title>@Speaker.Name — @Data.Site.Title</title> <meta name="description" content="@Speaker.Bio"/> </SectionContent> <p class="crumb"><a href="@(Links.To<HomePage>())">← Home</a></p> <h1>@Speaker.Name</h1> <p class="by">@Speaker.Role · @@@Speaker.Handle</p> <p class="lead">@Speaker.Bio</p> <h2>Sessions</h2> @foreach (var session in Data.Sessions.Where(s => s.Speaker.Id == Speaker.Id)) { <SessionCard Session="session"/> } @code { [Parameter] [EditorRequired] public Speaker Speaker { get; set; } = default!; }It lists the sessions that belong to this speaker with a plain LINQ
Where.Link to the new pages
Now you can link to them. Replace
Components/SessionCard.razorwith this version. It adds@inject ISiteLinks Linksand two links:samples/Bevel.Conference/Components/SessionCard.razorrazor @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!; }In
Pages/HomePage.razor, make each speaker's name a link:razor <a href="@Links.To(speaker)"><strong>@speaker.Name</strong></a>Add
@inject ISiteLinks Linksto the top of that file too.
Run it
Open the schedule and click a session title. You should land on a session page with the time, the room, the speaker's name and the talk text. Click the speaker.


Try it: add a new session file, save, and open /sessions/your-file-name. It exists.
Next: 6. Calendar feed.