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

Feature/butter cms #346

Merged
merged 64 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b568acd
feat(blog): added blog page and wired it up
Feb 25, 2019
1b7c77c
feat(blog): added master detail routing for blog posts
Feb 26, 2019
1f39d4a
feat(blog): added search and pagination to blog posts
Feb 26, 2019
ea11d2e
feat(blog): fixed issue with localStorage
Mar 4, 2019
52d5247
feat(blog): added index to track links for pre-render
Mar 4, 2019
1e37b7b
feat(blog): upgraded stencil and resolved dependency issues
Mar 6, 2019
3e6b7b5
feat(blog): implemented featured post and categories for blog
Mar 7, 2019
f3a5486
feat(blog): wired up blog-post page
Mar 7, 2019
2e000db
feat(blog): added layout styling to blog pages
Mar 8, 2019
411b24a
feat(blog): disabled filters on search
Mar 11, 2019
3080420
style(blog): add blog home styles
luiskcs89 Mar 11, 2019
2acba21
fix(blog): fix date format
luiskcs89 Mar 11, 2019
7791070
refactor(blog): merge and fix conflicts
luiskcs89 Mar 11, 2019
2a0a344
feat(blog): attempting to prerender
Mar 11, 2019
b6ff09c
feat(blog): changed prerender to use pre-build script to fetch data
Mar 11, 2019
19c35be
style(blog-post): add styles for blog post
luiskcs89 Mar 11, 2019
bb7128c
style(blog): add mobile styles for blog
luiskcs89 Mar 11, 2019
0c47498
style(blog-post): add mobile styles for blog post
luiskcs89 Mar 11, 2019
97be93a
refactor(blog): add prerender-blog-data to gitignore
Mar 12, 2019
852a880
refactor: merge and fix conflicts
luiskcs89 Mar 12, 2019
bf9fa88
fix(blog): fix author slug
Mar 12, 2019
5556210
fix(blog): fix to styles and spacer on no pagination
luiskcs89 Mar 12, 2019
78d2045
fix(blog): add radius to featured port image
luiskcs89 Mar 12, 2019
2ae5e7e
feat(blog): add share buttons
luiskcs89 Mar 12, 2019
60b88a5
refactor: fix conflict
luiskcs89 Mar 12, 2019
0372e8e
Merge branch 'feature/butter-cms' into blog-styles
luiskcs89 Mar 12, 2019
d3e5069
Merge branch 'blog-styles' of https://github.com/openforge/OPENFORGE.…
luiskcs89 Mar 12, 2019
c530e1f
feat(blog-webhook): set up firebase webhook
Mar 12, 2019
aa14d56
feat(blog): add loading spinners
luiskcs89 Mar 12, 2019
443912f
style(blog): change spinner color
luiskcs89 Mar 12, 2019
3b09114
feat(blog): add meta tags to blog pages for SEO
Mar 12, 2019
1de8e02
Merge pull request #345 from openforge/blog-styles
mm716783 Mar 13, 2019
a00a018
fix(blog): add get-butter.js to prepublish script
Mar 13, 2019
7065aa6
fix(blog): fix author slug
Mar 13, 2019
de959be
chore(blog): merge blog-styles into feature/butter-cms
Mar 13, 2019
1c747ba
refactor(blog): merge feature/blog-webhook into feature/butter-cms
Mar 13, 2019
15f6213
fix(blog): fix broken conditional in webp images
Mar 15, 2019
cf7d42d
fix(blog): update package.json to use get-butter.js on npm run dev
Mar 15, 2019
46919e4
docs(blog): added blog integration info to readme.md
Mar 15, 2019
bca6e59
fix(blog): delete package-lock.json
Mar 15, 2019
101d81e
docs(blog): add featured post info to readme.md
Mar 15, 2019
9382725
fix(): fix 3,4 & 5
Fdom92 Mar 19, 2019
0aa3adf
feat: hide API key from github
Mar 19, 2019
942f367
refactor: add to README.md
Mar 19, 2019
7341af7
refactor: edit README.md
Mar 19, 2019
c1916ce
refactor: edit readme
Mar 19, 2019
c582049
refactor: remove superfluous file, make API key blank and throw error
Mar 19, 2019
b51a71c
refactor: remove error throwing from getbutter
Mar 19, 2019
baaaea1
refactor: edit readme
Mar 19, 2019
edd8799
refactor: edit readme again
Mar 19, 2019
01c0254
refactor: comment back in code, error to be solved later
Mar 19, 2019
82bf8f2
Merge branch 'feature/butter-cms' into butter-api-key
samhudgens Mar 19, 2019
5052d15
style(blog-card): add divider between posts
luiskcs89 Mar 19, 2019
c27be3e
refactor(blog): add api key file to gitignore
Mar 20, 2019
3ae3f26
fix(blog): fix butter api token integration
Mar 20, 2019
8240945
fix(blog): fix API key for Travis build
Mar 20, 2019
25c5d31
fix(blog): another fix for travis
Mar 20, 2019
aec5218
fix(blog): cleanup stray comment
Mar 20, 2019
cffb4c9
fix(blog): make directory to fix travis build
Mar 20, 2019
2c521d3
Merge pull request #350 from openforge/butter-api-key
mm716783 Mar 20, 2019
1bf41f1
fix: add check for butter-api file existing in getbutter js
Mar 20, 2019
6178be1
refactor: edit readme and add webp files for blog images
Mar 28, 2019
9945983
Merge branch 'develop' of https://github.com/openforge/OPENFORGE.IO i…
PaulPaulDevelops Apr 1, 2019
6b30cc7
fix(blog): resolve issues from PR and style issues
PaulPaulDevelops Apr 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
386 changes: 386 additions & 0 deletions .firebase/hosting.d3d3.cache

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ Thumbs.db
UserInterfaceState.xcuserstate
.env
linters/sass-lint.html
src/pages/app-blog-post/prerender-blog-data.ts
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ For every commit, it will ensure files are linted and that the code is formatted

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`

## Blog Integration

## Deployment
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.

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.

### Featured Post

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.


## Deployment
```
npm run prepublish
```
Note that this will synchronously retrieve the blog post data from Butter CMS before building, so that it can be included in the prerender.

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

Expand Down
55 changes: 35 additions & 20 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,46 @@
"**/.*",
"**/node_modules/**"
],
"headers": [ {
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "**/*.@(jpg|jpeg|gif|png|js)",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=86400"
} ]
} , {
"source" : "**/*.@(js)",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=7200"
} ]
}],

"headers": [
{
"source": "**/*.@(eot|otf|ttf|ttc|woff|font.css)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png|js)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=86400"
}
]
},
{
"source": "**/*.@(js)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=7200"
}
]
}
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
}
8 changes: 8 additions & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Compiled JavaScript files
**/*.js
**/*.js.map

# Typescript v1 declaration files
typings/

node_modules/
Loading