Personal site and such: https://hurtlingthrough.space
How it was built: part 1 and part 2.
- Node version 8
- Yarn:
npm i -g yarn
yarn
It's probably worth noting that this repo uses a custom Gatsby plugin for processing markdown images (see plugins/gatsby-remark-images-full-width).
yarn new
Note that new posts automatically are set to draft: true
. Change this to draft: false
when you're ready to publish. Note that posts with draft: true
do not show up in the homepage, but are still accessible directly.
NOTE: posts that are draft: true
in the live
branch will show up in rss.xml! Strongly advise avoiding merging drafts into live. Use the --preview
flow described below instead.
draft: false
Twitter prompts default to "Check out 'title' URL via @cwpittman". Prompts will always end with the URL and "via @cwpittman", but you can change the first part.
twitterprompt: Cameron makes a huge mistake.
This makes the Twitter prompt: "Cameron makes a huge mistake. https://hurtlingthrough.space/... via @cwpittman"
The homepage will either display the excerpt for each post (the first ~200 chars?) or a predefined summary.
summary: A day in the life of my dog. Her perspective on going to the park, sniffing butts, and more with lots of pictures.
yarn dev
The dev site is available at http://localhost:8000. You can find a live GraphiQL at http://localhost:8000/___graphql.
Note that you must set draft: false
in the frontmatter of whatever posts you
want to be public.
All merges to live
automatically get published.
If you want to publish manually, run yarn deploy
(with the env vars detailed below). It will gatsby build
the production files and will run ./bin/deploy.js
to upload public/ to S3 and invalidate the CloudFront cache.
Create a .env
file in the root of the repo with the following environment variables:
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
BUCKET=
CLOUDFRONT_DISTRIBUTION_ID=
If you set up a CircleCI deployment, you'll need to set the aforementioned environment variables in the project settings. You can deploy to an S3 bucket called preview.[BUCKET]
if you append --preview
to the branch name.
gatsby-transformer-remark
seems to barf on[links](https://example.com/something_like_this)
with_
in them. Replace the_
s in the URL with their URL encoding,%5F
and you should be good to go, eg.[links](https://example.com/something%5Flike%5Fthis)
.- Seeing an error about
vips
? If you've runyarn
insideplugins/gatsby-remark-images-full-width
, blow away itsnode_modules
and rerunyarn
from the root of the repo. The issue is that we need yarn to fulfill the version of sharp as specified in the root of the repo, which does not require libvips >= 8.6.
The content and source code of this project are covered under two difference licenses. Source code is covered under the MIT license, while blog content is covered under the CC BY-SA 4.0 license. The directories containing files and content to which the CC BY-SA license applies have separate LICENSE files.