You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 5, 2022. It is now read-only.
#### Make Sure .webp Images are available by running the following commands:
44
+
#### Make Sure .webp Images are available by running the following commands inside the root folder:
45
45
```
46
46
for file in src/assets/*.jpg; do cwebp -q 75 "$file" -o "${file%.jpg}.webp"; done
47
47
```
@@ -54,6 +54,28 @@ for file in src/assets/*.png; do cwebp -q 75 "$file" -o "${file%.png}.webp"; don
54
54
for file in src/assets/*.jpeg; do cwebp -q 75 "$file" -o "${file%.jpeg}.webp"; done
55
55
```
56
56
57
+
### Blog Setup
58
+
By default, the public version of this project does not contain an API key for the [ButterCMS](https://buttercms.com/) blog content management system. You will need to add your own ButterCMS API key in order to make this project work.
59
+
60
+
The necessary file for inserting the ButterCMS API key will be auto-generated by running
61
+
```
62
+
node scripts/get-butter.js
63
+
```
64
+
65
+
After that, use your text editor and open the file:
66
+
```
67
+
src/butter-api/butter-api-key.ts
68
+
```
69
+
70
+
and enter your Butter API key between the single quotes '':
71
+
```
72
+
export const BUTTER_API_KEY = '';
73
+
```
74
+
to
75
+
```
76
+
export const BUTTER_API_KEY = 'your API token goes here';
77
+
```
78
+
57
79
### Running This Application
58
80
```
59
81
npm run dev
@@ -116,12 +138,22 @@ For every commit, it will ensure files are linted and that the code is formatted
116
138
117
139
If a developer went through providing all the information during a `npm run cz` only to find that there were issues with their commit. They may fix them and instruct commitizen to try the commit again with `npm run cz -- --retry`
118
140
141
+
## Blog Integration
119
142
120
-
## Deployment
143
+
This project uses [ButterCMS](https://buttercms.com/) as a headless content management system. When a user accesses the deployed site, the blog data will be loaded from the ButterCMS API via AJAX. However, the blog data is also utilized in prerendering the site, to improve SEO. Before any build (dev, prod, prerender), the get-butter.js script is run to retrieve the blog data and stored in pages/blog-post/prerender-blog-data.ts. This file is git-ignored so that the repo is not cluttered with blog content.
144
+
145
+
The project also utilizes webhooks from [ButterCMS](https://buttercms.com/docs/api/?javascript#webhooks) and [Travis](https://docs.travis-ci.com/user/triggering-builds) to keep the prerendered blog content up to date. Whenever a new blog post is published, Butter's webook invokes the cloud function rebuildMaster, which relays the information to the Travis API, which in turn will trigger a rebuild and redeploy of the master branch. Butter's webhooks are managed in the ButterCMS portal.
121
146
147
+
### Featured Post
148
+
149
+
The featured post is managed in the ButterCMS portal. To make a post featured, it must be given a tag of 'featured'. The actual featured post will be the most recently published post with the featured tag. Currently, this post will also appear in the regular list of posts.
150
+
151
+
152
+
## Deployment
122
153
```
123
154
npm run prepublish
124
155
```
156
+
Note that this will synchronously retrieve the blog post data from Butter CMS before building, so that it can be included in the prerender.
125
157
126
158
_Note: You may have to install firebase-tools via ```npm install -g firebase-tools``` and then authenticate via command line on your local machine to firebase_
0 commit comments