3. Sessions in Markdown

Write one Markdown file per session and link each to its speaker with a reference.

On this page
samples/Bevel.Conference/Data/Sessions/forty-seconds.mdmarkdown
---
title: "From Forty Minutes to Forty Seconds"
start: 2027-05-12T14:00:00
minutes: 45
room: "Main Hall"
speakerId: priya
summary: "A field guide to faster builds and calmer deploys."
---
Priya walks through a real build that got 60 times faster.

She covers caching, doing less work, and the one change that made the biggest difference. Spoiler: it was deleting code.

A talk is a document, so it gets a Markdown file. The block above is one real session. The speakerId line connects it to a speaker from step 2.

  1. Describe a session

    Create Data/Sessions/Session.cs:

    samples/Bevel.Conference/Data/Sessions/Session.cscsharp
    namespace Bevel.Conference.Data;
    
    [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);
    }

    Here is what Bevel does with it:

    • "./**/*.md" reads every Markdown file in this folder and below.
    • Front matter keys fill the matching members. start, minutes, room and summary are plain values.
    • Slug comes from the file name. RawMarkdown is the text below the front matter. Bevel fills both for you.
    • [Reference("Speakers")] Speaker Speaker links to the Speakers dataset. The key is speakerId in the front matter, and it matches the speaker's Id.
    • End is a plain C# property. Use ordinary C# for anything you can compute.

    The [GroupByDate] line on Start builds the Days group you use in step 4. Include it now.

  2. Write your sessions

    Create one .md file per session in Data/Sessions/. The sample has eight. Copy them from samples/Bevel.Conference/Data/Sessions, or write your own. Make them funny. Make them yours.

  3. Prove it works

    Add this to the bottom of Pages/HomePage.razor. You will replace it in the next step:

    razor
    <h2>Sessions</h2>
    <ul>
      @foreach (var session in Data.Sessions)
      {
        <li>@session.Start.ToString("ddd HH:mm") — <strong>@session.Title</strong> by @session.Speaker.Name</li>
      }
    </ul>

Run it

Save and refresh. You should see a list of sessions in time order. Each line shows the speaker's name, and you never wrote a lookup.

The home page with a Sessions list under the speakers. Each line shows a day and time, the session title in bold, and the speaker's name.
Step 3: sessions from Markdown, each with its speaker.

Try it: change speakerId: priya to speakerId: nobody and save. The build fails and names the file and the missing key. A broken link in your data cannot reach your readers.

Next: 4. Schedule grouped by day.