Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buttercms/hugo-starter-buttercms
Drop-in proof-of-concept Hugo app, fully integrated with your ButterCMS account
https://github.com/buttercms/hugo-starter-buttercms
blog buttercms cms go hugo netlify starter-framework starter-project
Last synced: 3 months ago
JSON representation
Drop-in proof-of-concept Hugo app, fully integrated with your ButterCMS account
- Host: GitHub
- URL: https://github.com/buttercms/hugo-starter-buttercms
- Owner: ButterCMS
- Created: 2022-07-20T13:27:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-11T13:38:03.000Z (over 1 year ago)
- Last Synced: 2024-06-21T02:17:19.616Z (8 months ago)
- Topics: blog, buttercms, cms, go, hugo, netlify, starter-framework, starter-project
- Language: SCSS
- Homepage: https://hugo-starter-buttercms.netlify.app/
- Size: 781 KB
- Stars: 5
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hugo + ButterCMS Starter Project
Live demo: [https://hugo-starter-buttercms.netlify.app/](https://hugo-starter-buttercms.netlify.app/)
This Hugo starter project fully integrates with dynamic sample content from your ButterCMS account, including main menu, pages, blog posts, categories, and tags, and all with a beautiful, custom theme. All of the included sample content is automatically created in your account dashboard when you
[sign up for a free trial](https://buttercms.com/join/) of ButterCMS.[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/ButterCMS/hugo-starter-buttercms#BUTTERCMS_API_TOKEN=Your_ButterCMS_Token_Here&BUTTERCMS_PREVIEW=false)
## 1) Installation
First, create a virtual environment and install dependencies by running the
below commands.```bash
$ git clone https://github.com/ButterCMS/hugo-starter-buttercms.git
$ cd hugo-starter-buttercms
$ go mod download
```### 2) Set ButterCMS API Token
To fetch your ButterCMS content, add your API token as an environment variable.
```bash
$ echo 'BUTTERCMS_API_TOKEN=your_token' >> .env
```### 3) Fetch Data from ButterCMS
To fetch your ButterCMS content run:
```bash
$ go run github.com/ButterCMS/hugo-starter-buttercms/prebuild
```*Because Hugo is a static site generator, you'll need to run this command for if you make changes to your Butter content and want to pull it into your app. For this reason, we recommend tapping into our webhook architecture, which will allow you to set up your deployed project to automatically show draft changes.*
### 5) Run Hugo Local Development Server
To view the app in the browser, you'll need to run the local development server:
```bash
$ hugo server
```Congratulations! Your starter project is now live at: [http://localhost:1313/](http://localhost:1313/)
### 6) Deploy on Netlify
Our starter app can be deployed to Netlify with the click of a button:
1. Create a Heroku account at https://app.netlify.com.
2. Click the button below and fill in an app name. Then click "Deploy to Netlify".[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/ButterCMS/hugo-starter-buttercms#BUTTERCMS_API_TOKEN=Your_ButterCMS_Token_Here&BUTTERCMS_PREVIEW=false)
### 7) Webhooks
In order for your deployed app to pull in content changes from your ButterCMS account, you'll need to follow your hosting provider's steps for setting up webhooks. The ButterCMS webhook settings are located at https://buttercms.com/webhooks/.
### 8) Previewing Draft Changes
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 the following value in your **.env** file: `BUTTERCMS_PREVIEW=false`.