This .NET starter project fully integrates with dynamic sample content from your ButterCMS account, including main menu, pages, blog posts, categories, and tags, all with a beautiful, custom theme with already-implemented search functionality. All of the included sample content is automatically created in your account dashboard when you sign up for a free trial of ButterCMS.
You can view a live demo hosted on Heroku, or you can click the button below to deploy your own copy of our starter project to the provider of your choice.
.NET Core SDK
at 3.1 or higherNote for Windows users - This SDK has been tested on the following configuration:
6.0.300 .NET SDK
.NET Runtimes:
Microsoft.AspNetCore.App 3.1.25
Microsoft.NETCore.App 3.1.25
First, clone the repo and install the dependencies by running dotnet restore
:
$ git clone https://github.com/ButterCMS/dotnet-starter-buttercms.git
$ cd dotnet-starter-buttercms
$ dotnet restore
To fetch your ButterCMS content, add your API token as an environment variable.
$ dotnet user-secrets set "ButterCMSAPIKey" "<YOUR API Token>" --project ButterCMS.Starter
To view the app in the browser, you'll need to run the local development server:
$ dotnet run --project ButterCMS.Starter
Congratulations! Your starter project is now live. To view your project, point your browser to http://localhost:5000.
Our starter app can be deployed to Heroku with the click of a button:
By default, your starter project is set up to allow previewing of draft changes saved in your ButterCMS.com account. To disable this functionality, set ButterCMSPreview
value to false
in your environment variables or appsettings.json
. Note that a value set in your environment variables takes precedence over appsettings.json
.
To set in environment variables on Mac/Linux:
$ export ButterCMSPreview=false
To set in environment variables on Windows:
$ set ButterCMSPreview=false
For PowerShell use:
$env:ButterCMSPreview="false"