Options
Every BevelOptions setting with its type, default and meaning.
On this page
builder.AddBevel(options =>
{
options.PathBase = "/repo";
options.SiteUrl = "https://me.github.io";
});
You set these in the callback you pass to builder.AddBevel(...). Each row shows the type, the default and what the setting does. Project-file settings live on MSBuild properties.
Use AddBevel on the WebApplicationBuilder, not on IServiceCollection. The builder version makes export mode work.
| Option | Type | Default | Meaning | Since |
|---|---|---|---|---|
IsDevelopment |
bool? |
null |
Render live (true), serve exported files (false), or follow the environment (null). |
0.1 |
OutputPath |
string? |
null |
Export directory. null means wwwroot. |
0.1 |
OutputStyle |
BevelOutputStyle |
DirectoryIndex |
DirectoryIndex or FlatHtml. |
0.1 |
DefaultLayout |
Type? |
null |
Layout component for pages without @layout. |
0.1 |
PrependDoctype |
bool |
true |
Add <!DOCTYPE html> when the page starts with <html. |
0.1 |
CopyStaticAssets |
bool |
true |
Copy wwwroot assets when exporting to another directory. |
0.1 |
StaticAssetsPath |
string? |
null |
Assets directory to copy. Defaults to wwwroot. |
0.1 |
ExcludeAssets |
IList<string> |
empty |
Globs (*.map, dev/**) for static files to leave out of the export. Live serving is unchanged. |
0.3 |
CleanOutputDirectory |
bool |
true |
Delete files a previous export wrote and this one no longer does. | 0.1 |
ExportParallelism |
int? |
null |
Pages rendered at the same time during an export. null means Math.Clamp(Environment.ProcessorCount / 2, 1, 8); 1 renders one at a time. Must be at least 1. Page code and services must be thread-safe. |
0.1 |
ExportOnStart |
bool? |
null |
Force export mode on or off. | 0.1 |
ExportOutputPath |
string? |
null |
Export directory for export mode. Overrides the command line. | 0.1 |
AssetFolders |
IList<BevelAssetFolder> |
empty |
Folders of images and other files served and exported as they are: new("Data/Posts", "/posts", "*.png"). Patterns are required. |
0.1 |
LogStats |
bool |
false |
Log what Bevel processed (datasets, routes, export) once at startup and once after an export. | 0.1 |
PathBase |
string |
empty |
Prefix for links when the site is hosted under a sub-path, such as /repo. Files are not moved. |
0.1 |
SiteUrl |
string? |
null |
Public origin of the deployed site, such as https://example.com. Used for absolute URLs, MapSitemap() and MapRobots(). Only the scheme and host count: set the sub-path with PathBase. A value that is not an absolute http or https URL throws. |
0.3 |
AfterExport |
IList<Func<BevelExportContext, CancellationToken, Task>> |
empty |
Steps that run after a successful export, in order, before steps registered with AddBevelExportStep. A step that throws fails the export. |
0.3 |
RewriteHtmlLinks |
bool |
false |
Prefix root-relative href, src, srcset, action and poster values in rendered HTML with PathBase, live and on export. Use it for HTML that comes from Markdown. It never double-prefixes. |
0.3 |