Skip to content

Commit

Permalink
Merge branch 'sculpin'
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
  • Loading branch information
evopix committed Apr 30, 2015
2 parents 564e936 + e2848e7 commit 11833d5
Show file tree
Hide file tree
Showing 55 changed files with 1,650 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
@@ -0,0 +1,7 @@
/.sculpin/
/app/cache/*
/app/config/sculpin_kernel_*.yml
/app/logs/*
/output_*/
/source/components/
s3.conf
119 changes: 119 additions & 0 deletions README.md
@@ -0,0 +1,119 @@
Sculpin Blog Skeleton
=====================

A skeleton for a Sculpin based blog.

Powered by [Sculpin](http://sculpin.io). =)


Features
--------

A very basic Sculpin based blog supporting the following features:

* Very minimal Bootstrap based theme.
* A handful of existing posts in `source/_posts/` to get you started. Feel
free to remove these when you are ready.
* An about page at `/about`.
* An index page at `/`. It displays all posts and paginates them.
* A blog archive page at `/blog`. It displays post titles broken down by
month and is paginated.
* A blog categories page at `/blog/categories`.
* A blog category index at `/blog/categories/$category`. Similar to the blog
archive except broken down by each category.
* A blog tags page at `/blog/tags`.
* A blog tag index at `/blog/tags/$tag`. Similar to the blog archive
except broken down by each tag.


Build
-----

### If You Already Have Sculpin

sculpin install
sculpin generate --watch --server

Your newly generated clone of sculpin-blog-skeleton is now
accessible at `http://localhost:8000/`.

### If You Need Sculpin

curl -O https://download.sculpin.io/sculpin.phar
php sculpin.phar install
php sculpin.phar generate --watch --server


Previewing Development Builds
-----------------------------

By default the site will be generated in `output_dev/`. This is the location
of your development build.

To preview it with Sculpin's built in webserver, run either of the following
commands. This will start a simple webserver listening at `localhost:8000`.

### Using Sculpin's Internal Webserver

#### Generate Command

To serve files right after generating them, use the `generate` command with
the `--server` option:

sculpin generate --server

To listen on a different port, specify the `--port` option:

sculpin generate --server --port=9999

Combine with `--watch` to have Sculpin pick up changes as you make them:

sculpin generate --server --watch


##### Server Command

To serve files that have already been generated, use the `serve` command:

sculpin serve

To listen on a different port, specify the `--port` option:

sculpin serve --port=9999


### Using a Standard Webserver

The only special consideration that needs to be taken into account for standard
webservers **in development** is the fact that the URLs generated may not match
the path at which the site is installed.

This can be solved by overriding the `site.url` configuration option when
generating the site.

sculpin generate --url=http://my.dev.host/blog-skeleton/output_dev

With this option passed, `{{ site.url }}/about` will now be generated as
`http://my.dev.host/blog-skelton/output_dev/about` instead of `/about`.


Publishing Production Builds
----------------------------

When `--env=prod` is specified, the site will be generated in `output_prod/`. This
is the location of your production build.

sculpin generate --env=prod

These files are suitable to be transferred directly to a production host. For example:

sculpin generate --env=prod
rsync -avze 'ssh -p 999' output_prod/ user@yoursculpinsite.com:public_html

If you want to make sure that rsync deletes files that you deleted locally on the on the remote too, add the `--delete` option to the rsync command:

rsync -avze 'ssh -p 999' --delete output_prod/ user@yoursculpinsite.com:public_html

In fact, `publish.sh` is provided to get you started. If you plan on deploying to an
Amazon S3 bucket, you can use `s3-publish.sh` alongside the `s3cmd` utility (must be
installed separately).
3 changes: 3 additions & 0 deletions app/config/sculpin_kernel.yml
@@ -0,0 +1,3 @@
sculpin_content_types:
posts:
permalink: blog/:year/:month/:day/:filename/
57 changes: 57 additions & 0 deletions app/config/sculpin_site.yml
@@ -0,0 +1,57 @@
# The contents of this file are parsed and made available as
# via `site.*`. So for example, {{ site.title }} can be used
# in a template to get the contents of the `title` key.
title: Brandon Summers
subtitle:
sidebar: none
author: Brandon Summers

# ----------------------- #
# 3rd Party Settings #
# ----------------------- #

# Github repositories
github_user: evopix
github_repo_count: 3
github_show_profile_link: true
github_skip_forks: true

# Twitter
twitter_user: bsummers82
twitter_tweet_count: 4
twitter_show_replies: false
twitter_follow_button: true
twitter_show_follower_count: false
twitter_tweet_button: true

# Google +1
google_plus_one: false
google_plus_one_size: medium

# Google Plus Profile
# Hidden: No visible button, just add author information to search results
googleplus_user:
googleplus_hidden: false

# Pinboard
pinboard_user:
pinboard_count: 3

# Delicious
delicious_user:
delicious_count: 3

# Disqus Comments
disqus:
shortname: brandonsummers
show_comment_count: false

# Google Analytics
google_analytics_tracking_id: UA-29125605-1

# Facebook Like
facebook_like: false

# Diigo
diigo_user: bsummers82
diigo_count: 5
3 changes: 3 additions & 0 deletions app/config/sculpin_site_prod.yml
@@ -0,0 +1,3 @@
imports:
- sculpin_site.yml
url: http://evopix.github.com
13 changes: 13 additions & 0 deletions publish.sh
@@ -0,0 +1,13 @@
#!/bin/bash

# Replace "sculpin generate" with "php sculpin.phar generate" if sculpin.phar
# was downloaded and placed in this directory instead of sculpin having been
# installed globally.

sculpin generate --env=prod
if [ $? -ne 0 ]; then echo "Could not generate the site"; exit 1; fi

# Add --delete right before "output_prod" to have rsync remove files that are
# deleted locally from the destination too. See README.md for an example.
rsync -avze 'ssh -p 4668' output_prod/ username@yoursculpinsite:public_html
if [ $? -ne 0 ]; then echo "Could not publish the site"; exit 1; fi
58 changes: 58 additions & 0 deletions s3-publish.sh
@@ -0,0 +1,58 @@
#!/bin/bash

if [ ! -f "s3.conf" ]
then
echo "Unable to locate s3.conf file - use s3.conf.dist as a template for configuring your S3 settings."
exit 1
else
# Load config file
. s3.conf
fi

if [ ! -z "$1" -a "$1" != "--dry-run" -a "$1" != "-n" ]
then
echo "Usage: ./publish.sh [--dry-run|-n]"
exit 2
fi

# Would be a good idea to wipe out the prod env first, so that DELETE_REMOVED works properly
# If you're comfortable with that, uncomment the line below:
# rm -rf output_prod/*

vendor/bin/sculpin generate --env=prod || ( echo "Could not generate the site" && exit )

S3CMD_PATH=`which s3cmd`
if [ $? -ne 0 -o -z "$S3CMD_PATH" ]
then
echo "s3cmd not found - unable to deploy"
exit 3
fi

if [ ! -f "$S3_CONFIG" ]
then
echo "Unable to find s3cmd config file - unable to deploy"
exit 4
fi

if [ "$S3_DELETE" = "true" ]
then
echo "Enabling DELETE_REMOVED"
DELETE_REMOVED='--delete-removed'
else
echo "Disabling DELETE_REMOVED"
DELETE_REMOVED='--no-delete-removed'
fi

if [ "$S3_REGION" = "" ]
then
S3_REGION=US
fi

if [ "$1" = "--dry-run" -o "$1" = "-n" ]
then
DRY_RUN='--dry-run'
else
DRY_RUN=''
fi

s3cmd --config="$S3_CONFIG" $DRY_RUN --force --recursive $DELETE_REMOVED --bucket-location=$S3_REGION --progress --acl-public sync output_prod/ s3://$S3_BUCKET
14 changes: 14 additions & 0 deletions s3.conf.dist
@@ -0,0 +1,14 @@
# Path to s3cmd configuration file for your Amazon S3 bucket
# This is useful if you have multiple sets of credentials - you can give Sculpin a locked-down IAM key for deployments
S3_CONFIG=./.s3/s3cmd.conf

# Delete files from S3 bucket that are not created by sculpin (e.g., if you delete a blog post, this will remove the corresponding HTML files for you)
# NOTE: If you ever upload files to your bucket that are not a part of your sculpin deployment, THIS SETTING WILL DELETE THEM.
# This is why it is set to "false" by default; change to "true" in order to have sculpin fully manage your bucket contents.
S3_DELETE=false

# Region for S3. Set to Oregon by default, because Oregon S3 has special read-after-write consistency.
S3_REGION=us-west-2

# The name of your S3 bucket
S3_BUCKET=www.mydomain.com
Binary file added sculpin
Binary file not shown.
26 changes: 26 additions & 0 deletions sculpin.json
@@ -0,0 +1,26 @@
{
"name": "sculpin/blog-skeleton",
"description": "A Skeleton for a Sculpin Based Blog",
"type": "sculpin-skeleton",
"license": "MIT",
"authors": [
{
"name": "Dragonfly Development Inc.",
"email": "info@dflydev.com",
"homepage": "http://dflydev.com"
},
{
"name": "Beau Simensen",
"email": "beau@dflydev.com",
"homepage": "http://beausimensen.com"
}
],
"require": {
"components/bootstrap": "~2.3.1",
"components/jquery": "~1.9.1",
"components/highlightjs": "~7.3.0"
},
"config": {
"component-dir": "source/components"
}
}

0 comments on commit 11833d5

Please sign in to comment.