After upgrading to Gatsby v3 I noticed builds on netlify seemed to be taking a long time.
The main component taking time on builds seemed to be netlify cms.
- disabled plugin gatsby-plugin-netlify-cms to speed up build times
- removed netlify-cms-app
- removed gatsby-plugin-netlify
- removed gatsby-plugin-netlify-cms
- added admin/index.html to use pre-built netlify-cms from web
- removed postb script from build in package.json
Changed netlify-cms to use external pre-built js to speed up build times.
The main difference between using the netlify cms react component & using pre-built js from netlify is the post preview when editing in netlify cms.
It is possible to set custom css styles for the preview pane on pre-built netlify-cms using
Removed some dependencies which are no longer required for the blog.
- disabled postcss plugin lostgrid
- disabled plugin gatsby-remark-copy-linked-files
- disabled plugin gatsby-remark-smartypants
- removed gatsby-remark-smartypants
- removed gatsby-remark-copy-linked-files
- removed lost
As I had disabled gatsby-plugin-netlify due to a problem with webpack on upgrading gatsby I added some default header rules with basic security headers.
X-Frame-Options = "DENY" X-XSS-Protection = "1; mode=block" X-Content-Type-Options = "nosniff" Referrer-Policy = "same-origin"
A cool feature with netlify is the ability to set redirects allowing me to redirect common RSS uri's (
- RSS Feed
- Github Profile
- Twitter Profile
Redirects can also forward to external websites.
I added redirects to my github & twitter profiles. (
[[redirects]] from = "/github" to = "https://github.com/equk" status = 301 force = true
The source for the site is available on github.