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 SDKat 8.0 or higher
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 restoreTo fetch your ButterCMS content, add your API token as an environment variable.
$ dotnet user-secrets set "ButterCMSAPIKey" "<YOUR API Token>" --project ButterCMS.StarterTo view the app in the browser, you'll need to run the local development server:
$ dotnet run --project ButterCMS.StarterCongratulations! 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:
- Create a Heroku account at https://signup.heroku.com.
- Click the button below and fill in an app name and your Butter API token. Then click "deploy".
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=falseTo set in environment variables on Windows:
$ set ButterCMSPreview=falseFor PowerShell use:
$env:ButterCMSPreview="false"