Templates

The bevel and bevel-blog dotnet new templates, their options and what each one creates.

On this page
bash
dotnet new install Bevel.Templates
dotnet new bevel-blog -n MyBlog --site-title "My Blog"
Since 0.2

The Bevel.Templates package adds two dotnet new templates. Each pins its Bevel package reference to the version of the template pack, set when the pack is built.

Template Short name What you get
Bevel static site bevel A minimal site: one dataset, one Razor page.
Bevel blog bevel-blog A Markdown blog with authors, paging, RSS and a sitemap.

Options

Option Templates Default Meaning
--site-title both My Bevel Site (bevel), My Bevel Blog (bevel-blog) The site title. Keep it JSON-safe: no double quotes or backslashes.
--base-path both empty Path base for hosting under a sub-path such as /repo (GitHub project pages).
--no-sample-content bevel-blog false Include only Data/Posts/welcome.md instead of the sample posts.

The name you pass with -n becomes the project name and folder.

The bevel template

  • MyBevelSite/
  • MyBevelSite.csproj
  • Program.cs
  • Components/
  • MainLayout.razor
  • Data/
  • Site/
  • SiteInfo.cs
  • site.json
  • Pages/
  • HomePage.razor
  • wwwroot/
  • css/site.css

You get one Site dataset loaded from site.json, a layout and a home page. Start here when you want to add your own datasets.

The bevel-blog template

  • MyBlog/
  • MyBlog.csproj
  • Program.cs
  • SyndicationBuilder.cs
  • Components/
  • MainLayout.razor
  • Markdown.razor
  • PostCard.razor
  • Data/
  • Authors/
  • Author.cs
  • authors.json
  • Posts/
  • BlogPost.cs
  • PostProcessors.cs
  • hello-world.md
  • draft-post.md
  • folder-post/
  • Site/
  • SiteConfig.cs
  • site.yaml
  • Pages/
  • HomePage.razor
  • PostPage.razor
  • AboutPage.razor
  • NotFoundPage.razor
  • Posts live in Data/Posts/*.md, or Data/Posts/<slug>/index.md with images beside them.
  • draft: true keeps a post out of Release exports. Drafts show in dotnet watch and Debug builds.
  • Set baseUrl in Data/Site/site.yaml to your site's origin, with no path.
  • With --no-sample-content, only welcome.md is included. Without it, you get hello-world.md, a folder post with an image and a draft, and no welcome.md.

Preview and export

bash
dotnet watch                              # live pages while you edit
dotnet run -c Release -- --bevel-build    # static HTML into wwwroot/

The export goes into wwwroot/, which is git-ignored. wwwroot/css/ is kept. Deploy that folder to any static host. See CLI and environment.