Flip Flops: Quite blogging, go to the beach.
Take a little syntax out of your life. It's just a file system and your words.
- Create a folder for your project. Put it in source control, if you want. This folder is outside of the flipflops repo and is completely separate.
- Copy config.js from flipflops repo to your project.
- Change the few settings to your name, blog title, etc.
- Create a folder,
posts. This folder has all your blog posts, distinct from pages in the site.
- Inside posts, create folders for YYYY/MM/DD/ for each blog post. Every post must be in a folder meeting that structure.
- To create a post, create a folder and
- To configure the post, create a YAML header. Current frontmatter supported is
---title: Post Titledate: 2014-06-25T15:31:00.000-0500author: Post Author (default's to author in config::site.author)categories:- Category- Other---
Once that's in place, you're ready to start flipflops. From the flipflops folder
CONFIG_FILE=/Users/username/full/path/to/project/config.js node app.js
If you do happen to like hacking on the beach, check out our design docs!
Flipflops runs a few different ways.
- node For standalone development work, simply running
node app.jswill have you up and running most quickly.
- Docker For production use, grab the docker container (coming soon!).
- Passenger For some development workflows, Phusion Passenger is a great tool for managing the lifecycle of the app.
- Supervisor To minimize external dependencies, Flipflops is configured to use [node-supervisor][supervisor] for lifecycle management.
npm start script will use passenger if it's in the path, or supervisor
otherwise. The docker container uses supervisor, but that's under the hood.
Flipflops can be configured using a variety of environment variables, including NODE_NEV, NEW_RELIC_LICENSE_KEY, and many others. It is your responsibility to handle those safely for your environment. Flipflops has a deploy script that helps out, if you have a private git repo.
Create a private repo, for all secure project settings (this works across all
projects). Create a branch for flipflops (
git branch --orphan flipflops ; git checkout flipflops). Create a
.sh file for each environment you need; I
production.sh at a minimum. Put any environment
vars in those. Commit and push this branch.
In flipflops, create an environment variable
that you just created. Run
sh ./src/deploy/env/load.sh ENVIRONMENT, where
ENVIRONMENT is the name of the .sh file (without the .sh) you just created.
Now, when you start flipflops with
npm start, these settings will be loaded.