This repository has been archived by the owner. It is now read-only.
A different brew of Second Crack, a static-file Markdown blogging engine.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 65 commits ahead, 4 commits behind marcoarment:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cap
engine
resources
.LICENSE
.gitignore
.gitmodules
Capfile
README.md
config.php

README.md

Continental is a name for the Vienna stage of coffee roasting which happens right at the beginning of Second Crack.

Continental

Continental is a fork of Marco Arment's Second Crack. After using it for a while, I wanted to make some drastic changes to the structure of the repo to simplify it for my use, accommodate my preferences, and set it up for deployment as private repos for my blogs.

In many cases, this fork won't be ideal for out-of-the-box configuration. I'll try to keep up with documentation and changes from Second Crack to make deployment easy. If you're just starting with Second Crack, I'd recommend using Marco's original repository and can be deployed using my deploysecondcrack tool.

New Features and Fixes

Here's a list of new features that I have added or fixed compared to the original Second Crack:

  • Tags have been moved out of the root of www and now are served from website.com/tag/foo.
  • Fixed month archive cache bug
  • Writes all pages with .html extension and uses .htaccess to keep the URL clean.
  • Adds capistrano for deploys. Edit cap/deploy.rb to configure. Dependancies: ruby, rails, capistrano, railsless-deploy.
  • Configuration based on environment
  • Nested pages
  • Custom pages templates by defining in the post/page header
  • Support for having your blog roll live in a subdirectory like yoursite.com/blog
  • Adds short/cleaner URLs by optionally writing to .htaccess of short domain on same server
  • Adds a list of all posts along with optional template to create an /archive page.

When possible, I'll make pull requests upstream so all Second Crack users can benefit from fixes and changes.

To Dos

See Issues for bugs and pending features.

Migrating from Second Crack

If you want to move from Second Crack to Continental, below is a general guideline of the steps you'll need to consider. This is not a step-by-step guide or something for beginners. This is not full documentation. Again, if you're new to Second Crack, or system administration, I suggest using deploysecondcrack.

Using capistrano:

  • Set up capistrano and any dependancies (ruby, rails, capistrano, railsless-deploy)
  • Configure cap/deploy.rb:
    • Ideal configuration is to fork Continental and deploy your fork. Put your fork's URL in :repository in cap/deploy.rb
    • Edit cap/deploy.rb with your server settings. So you don't bring down your current site, you'll want to make the /path/to/website different than where your document root currently is.
    • Custom capistrano methods should work right if you keep your assets in the same structure as in Continental
    • SSH into your server and mkdir the /path/to/website and set the proper permissions and ownership for the :user in cap/deploy.rb
  • Run cap setup, then cap check, then cap deploy to roll out your site initially
  • Run cap deploy for any later updates after initial configuration
  • Set up config.php including your server's hostname and home path for environment set up and all path configuration. Continental supports configuration for both local development and production configuration. $env sets which paths to use.
  • Move any hooks or templates that you had in Dropbox to their respective place in /resources/templates/ and /engine/hooks/
  • Change your httpd virtual host to point to your new document root in /path/to/website and restart.

Using git clone:

  • Clone your fork of continental wherever you like
  • Set up config.php including your server's hostname and home path for environment set up and all path configuration. Continental supports configuration for both local development and production configuration. $env sets which paths to use. When using git to deploy your site rather than cap, your path configurations will look more like what's set in the else of if production.
  • Move any hooks or templates that you had in Dropbox to their respective place in /resources/templates/ and /engine/hooks/
  • Change your httpd virtual host to point to your new document root in /path/to/website and restart.

Notes

  • Refer to the README for Second Crack for basic usage.

  • Since I run multiple Second Crack blogs on the same server, I've added a feature to specify the name of the blog in the cron command which will be logged properly. Add the blog name at the end of the run command like this:

      /home/blog/continental/engine/update.sh {SOURCE_PATH} {SECONDCRACK_PATH} my_blog
    
  • Nested pages work by adding a folder in the /pages directory. Any .md files created in, for example, /pages/foo/bar.md will be created in /www/foo/bar.html. Create /pages/foo/index.md to have a page exist at yoursite.com/foo. I still need to add deletion of /www/foo folder when /pages/foo is removed.

  • Specify a template in the header of a file like this: template: writing where you have a writing.php file in your /templates directory.

  • For moving your blog roll into a subdirectory, set Updater::$blog_path and Post::$blog_uri in config.php. Create index.md in /pages to be your home page.

Change Log

  • [2012-12-01]: Moved post tags to /tags/ and month archive tags to /year/month/tag. [See Commit]
  • [2012-12-01]: Fixed month archive cache bug. [See Commit]
  • [2012-12-01]: All pages now are written with .html extension for semantic purposes. [See Commit]
  • [2012-12-01]: Better logging of blog name for when running multiple blogs on the same server. [See Commit]
  • [2012-12-02]: Added capistrano.[See Commit]
  • [2012-12-02]: Added environment configuration and production-only hooks. [See Commit]
  • [2012-12-08]: Added nested pages. [See Commit]
  • [2012-12-09]: Added ability to specify alternate template in a page header. [See Commit]
  • [2012-12-21]: Added support for blog living at yoursite.com/blog. Settings in config.php. [See Commit]
  • [2012-12-29]: Added support for short/cleaner URLs like u.co/post-slug. [See Commit]
  • [2013-05-05]: Adds AppDotNetPHP submodule in engine/lib for use in new ADN post hook. [See Commit]
  • [2013-06-11]: Adds /archive page with a list of all post titles and gives option for separate archive template. [See Commit]
  • [2013-06-18]: Fixes issue with draft not having .html extension when using $write_public_drafts feature. [See Commit]