This repository houses the source code for the Simple.org website.
We use Middleman to build the static pages which are hosted on GitHub Pages.
To run the site on your own machine, simply clone the repo, install the packages necessary, and start up a Middleman server.
$ git clone [email protected]:resolvetosavelives/simple.org.git
$ cd simple.org
$ bundle install
$ middleman server
If you see an error with middleman, 'Unknown command middleman' then try:
$ bundle exec middleman
OR
$ bundle exec middleman server
After merging your commits to master
and pulling the latest, run rake publish
.
Error: src refspec gh-pages does not match any
- Run
git pull origin master
- Run
git fetch
- Run
rm -rf build
to delete yourbuild/
directory - Run
rake publish
Error: Could not find middleman-blog-4.0.3 in any of the sources
- Make sure you have the proper ruby version installed. Note: If you're using
rvm
, runrvm use 2.5.1
to use Ruby version 2.5.1. - Run
rm -rf build
to delete yourbuild/
directory - Run
rake publish
To add a new contributor to simple.org/about, do the following:
- Add a contributor item to
data/contributors.yml
- Open
locales/en.yml
for a list of available roles and countries. Note: Please make sure the string you set incontributors.yml
exactly matches the key in theen.yml
file. Otherwise the role/country will display an error. - Make sure the contributor is properly displayed in your local
- Merge and deploy (if you have deployment issues, check "Deployment" section below)
Contributors are listed alphabetically by last name
To add a new blog article, do the following:
- Create a new branch: Pull the lastest from master and create a new branch.
- Create a new file: Add a new file in
source/blog/
using the following extension and naming convention:year-month-day-my-new-article.html.erb
. - Paste front-matter: Open an old article in
source/blog/
and copy and paste the front-matter content to your new article. - Update front-matter: Update the front-matter variables with your content. Note: Make sure to wrap all variable content within
" "
. - Set an author: If the article's author is a contributor listed in
data/contributors/yml
, make sure to add their exact name in theauthor
variable. If the author isn't a contributor, follow the "Add a new contributor to Simple.org" instructions above before proceeding. - Add article images: Add your article images in
/images/blog/my-new-article/
. - Image placeholders: Re-export your images with a width of
50px
and a Figma layer blur of1
. Image placeholders are used to lazy-load images and reduce initial page load times. - Create your content: Use an existing article for reference to properly format and structure your article's content. There are no wrapping
div
s around the content—it's just a bunch ofsection
s and imagediv
s! - Merge to master: Check your article in your local on small and large devices. Once it's ready merge into master.
- Publish your article: Follow the instructions in the "Deployment" section above to publish your new article.
- Optimise any images: Head to tinypng and minimise all images used in the blog post for faster loading. It will minimise both png and jpg files in the same drop zone.
If you have any questions please contact Jamie at [email protected].