... | ... |
@@ -1,13 +1,41 @@ |
1 |
-= What is Octopress? |
|
1 |
+# What is Octopress? |
|
2 |
+Octopress gives developers a well designed starting point for a Jekyll blog. It's easy to configure and easy to deploy. Sweet huh? |
|
2 | 3 |
|
3 |
-Octopress gives developers a well designed starting point for their blog. It's easy to configure and easy to deploy. Sweet huh? |
|
4 |
+## Why? |
|
5 |
+1. Building a Jekyll blog from scratch is a lot of work. |
|
6 |
+2. Jekyll doesn't have default layouts or themes. |
|
7 |
+3. Most developers don't want to do design. |
|
4 | 8 |
|
5 |
-== Octopress uses |
|
9 |
+## Octopress is made of |
|
6 | 10 |
- [Jekyll](http://github.com/henrik/jekyll) a blog aware static site generator (Henrik's fork adds [HAML](http://haml-lang.com) support) |
7 | 11 |
- [Compass](http://compass-style.org) an awesome [SASS](http://sass-lang.com) framework. |
8 | 12 |
- [FSSM](http://github.com/ttilley/fssm/tree/master) + a rake task, automatically regenerates the blog as you work. |
9 | 13 |
- [Serve](http://github.com/jlong/serve) for live previews of the site while in development |
10 | 14 |
- [Rsync](http://samba.anu.edu.au/rsync/) for easy deployment. |
11 | 15 |
|
12 |
-= Setup |
|
13 |
-- add gem install instructions |
|
14 | 16 |
\ No newline at end of file |
17 |
+## Setup |
|
18 |
+#### First, clone Octopress locally. |
|
19 |
+ git clone git://github.com/imathis/octopress.git |
|
20 |
+#### Second, install required gems |
|
21 |
+ sudo gem install henrik-jekyll |
|
22 |
+ sudo gem install compass-edge |
|
23 |
+ sudo gem install fssm |
|
24 |
+ sudo gem install serve |
|
25 |
+ |
|
26 |
+#### Third |
|
27 |
+1. Edit the top of the Rakefile settings to match your web hosting info. |
|
28 |
+2. Edit the top of the atom.haml and _layout/default.haml |
|
29 |
+ |
|
30 |
+## Usage |
|
31 |
+You should really read over the [Jekyll wiki](http://wiki.github.com/mojombo/jekyll) because most of your work will be using Jekyll. Beyond that Octopress is mostly some rake tasks, HAML, and SASS/Compass that has been meticulously crafted for ease of use and modification. |
|
32 |
+ |
|
33 |
+### Rake tasks |
|
34 |
+rake preview: Generates the site, starts the local web server, and opens your browser to show the generated site. |
|
35 |
+ |
|
36 |
+rake watch: Watches the source for changes and regenerates the site every time you save a file. You'll forget your working with a static site. |
|
37 |
+ |
|
38 |
+rake deploy: Generates the site and then uses rsync (based on your configurations in the Rakefile) to synchronize with your web host. In order to use rsync you'll need shell access to your host, and you'll probably want to use your public key for authentication. |
|
39 |
+ |
|
40 |
+rake stop_serve: Kills the local web server process. |
|
41 |
+ |
|
42 |
+*There are more but these are the ones you'll use the most. Read the Rakefile if you want to learn more* |
|
15 | 43 |
\ No newline at end of file |
... | ... |
@@ -1,14 +1,15 @@ |
1 | 1 |
require 'active_support' |
2 | 2 |
|
3 |
+## -- CHANGE FOR YOUR PROJECT -- ## |
|
4 |
+site_url = "http://yoursite.com" # deployed site url |
|
5 |
+ssh_user = "user@host.com" # for rsync deployment |
|
6 |
+document_root = "~/document_root/" # for rsync deployment |
|
7 |
+## ---- ## |
|
8 |
+ |
|
3 | 9 |
port = "4000" # preview project port eg. http://localhost:4000 |
4 | 10 |
site = "site" # compiled site directory |
5 | 11 |
source = "source" # source file directory |
6 | 12 |
|
7 |
-# MUST CHANGE FOR YOUR PROJECT |
|
8 |
-site_url = "http://yoursite.com" # deployed site url |
|
9 |
-ssh_user = "user@host.com" # for rsync deployment |
|
10 |
-document_root = "~/document_root/" # for rsync deployment |
|
11 |
- |
|
12 | 13 |
def ok_failed(condition) |
13 | 14 |
if (condition) |
14 | 15 |
puts "OK" |
... | ... |
@@ -29,6 +30,11 @@ task :clean do |
29 | 29 |
Dir["#{site}/*"].each { |f| rm_rf(f) } |
30 | 30 |
end |
31 | 31 |
|
32 |
+task :clean_debug do |
|
33 |
+ puts "Removing debug pages..." |
|
34 |
+ Dir["#{site}/debug"].each { |f| rm_rf(f) } |
|
35 |
+end |
|
36 |
+ |
|
32 | 37 |
desc "generate website in output directory" |
33 | 38 |
task :generate => :clean do |
34 | 39 |
puts "Generating website..." |
... | ... |
@@ -56,7 +62,7 @@ task :watch do |
56 | 56 |
end |
57 | 57 |
|
58 | 58 |
desc "generate and deploy website" |
59 |
-task :deploy => :generate do |
|
59 |
+multitask :deploy => [:generate, :clean_debug] do |
|
60 | 60 |
print "Deploying website..." |
61 | 61 |
ok_failed system("rsync -avz --delete #{site}/ #{ssh_user}:#{document_root}") |
62 | 62 |
end |