Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit ad3170a

Browse files
authored
Merge branch 'develop' into cypress-int
2 parents d91315d + c24c28d commit ad3170a

File tree

410 files changed

+12904
-6742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

410 files changed

+12904
-6742
lines changed

.firebase/hosting.d3d3.cache

Lines changed: 386 additions & 0 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ Thumbs.db
2424
UserInterfaceState.xcuserstate
2525
.env
2626
linters/sass-lint.html
27+
src/pages/app-blog-post/prerender-blog-data.ts
28+
src/butter-api/butter-api-key.js

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ script:
1111
- npm run build
1212

1313
after_success:
14-
- node scripts/deploy.js
14+
- npm run firebase:deploy

CHANGELOG.md

Lines changed: 218 additions & 122 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,49 @@ The OpenForge.io website is built using a combination of [Stencil.js](https://st
3333
npm install
3434
```
3535

36+
#### Install the Google WebP utility from the following link:
37+
https://developers.google.com/speed/webp/docs/precompiled
38+
39+
#### Or install from the command line (Mac OS X):
40+
```
41+
brew install webp
42+
```
43+
44+
#### Make Sure .webp Images are available by running the following commands inside the root folder:
45+
```
46+
for file in src/assets/*.jpg; do cwebp -q 75 "$file" -o "${file%.jpg}.webp"; done
47+
```
48+
49+
```
50+
for file in src/assets/*.png; do cwebp -q 75 "$file" -o "${file%.png}.webp"; done
51+
```
52+
53+
```
54+
for file in src/assets/*.jpeg; do cwebp -q 75 "$file" -o "${file%.jpeg}.webp"; done
55+
```
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+
3679
### Running This Application
3780
```
3881
npm run dev
@@ -95,12 +138,22 @@ For every commit, it will ensure files are linted and that the code is formatted
95138

96139
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`
97140

141+
## Blog Integration
98142

99-
## 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.
146+
147+
### Featured Post
100148

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
101153
```
102154
npm run prepublish
103155
```
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.
104157

105158
_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_
106159

firebase.json

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,46 @@
66
"**/.*",
77
"**/node_modules/**"
88
],
9-
"headers": [ {
10-
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
11-
"headers" : [ {
12-
"key" : "Access-Control-Allow-Origin",
13-
"value" : "*"
14-
} ]
15-
}, {
16-
"source" : "**/*.@(jpg|jpeg|gif|png|js)",
17-
"headers" : [ {
18-
"key" : "Cache-Control",
19-
"value" : "max-age=86400"
20-
} ]
21-
} , {
22-
"source" : "**/*.@(js)",
23-
"headers" : [ {
24-
"key" : "Cache-Control",
25-
"value" : "max-age=7200"
26-
} ]
27-
}],
28-
9+
"headers": [
10+
{
11+
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
12+
"headers": [
13+
{
14+
"key": "Access-Control-Allow-Origin",
15+
"value": "*"
16+
}
17+
]
18+
},
19+
{
20+
"source": "**/*.@(jpg|jpeg|gif|png|js)",
21+
"headers": [
22+
{
23+
"key": "Cache-Control",
24+
"value": "max-age=86400"
25+
}
26+
]
27+
},
28+
{
29+
"source": "**/*.@(js)",
30+
"headers": [
31+
{
32+
"key": "Cache-Control",
33+
"value": "max-age=7200"
34+
}
35+
]
36+
}
37+
],
2938
"rewrites": [
3039
{
3140
"source": "**",
3241
"destination": "/index.html"
3342
}
3443
]
44+
},
45+
"functions": {
46+
"predeploy": [
47+
"npm --prefix \"$RESOURCE_DIR\" run lint",
48+
"npm --prefix \"$RESOURCE_DIR\" run build"
49+
]
3550
}
3651
}

functions/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Compiled JavaScript files
2+
**/*.js
3+
**/*.js.map
4+
5+
# Typescript v1 declaration files
6+
typings/
7+
8+
node_modules/

0 commit comments

Comments
 (0)