Templates
The bevel and bevel-blog dotnet new templates, their options and what each one creates.
On this page
dotnet new install Bevel.Templates
dotnet new bevel-blog -n MyBlog --site-title "My Blog"
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, orData/Posts/<slug>/index.mdwith images beside them. draft: truekeeps a post out of Release exports. Drafts show indotnet watchand Debug builds.- Set
baseUrlinData/Site/site.yamlto your site's origin, with no path. - With
--no-sample-content, onlywelcome.mdis included. Without it, you gethello-world.md, a folder post with an image and a draft, and nowelcome.md.
Preview and export
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.