<h1>Blogging with Octopress</h1>

<p>Static html site generators automate many of the tedious steps that are necessary
to create website.  Octopress is a static html generator that automates many of the tedious tasks of static html site generators, and comes with a number of reasonable presets, configured right out of the box.</p>

<h2>Static HTML Site Generators I looked at:</h2>
<ul>
<li>Jekyll: <a href="https://jekyllrb.com">https://jekyllrb.com/</a></li>
<li>Jekyll-bootsrap: <a href="https://jekyllbootstrap.com/">https://jekyllbootstrap.com/</a></li>
<li>Pelican: <a href="https://docs.getpelican.com/en/3.3.0/">https://docs.getpelican.com/en/3.3.0/</a></li>
<li>Templer: <a href="https://www.steve.org.uk/Software/templer/">https://www.steve.org.uk/Software/templer/</a> (<a href="https://hackerpublicradio.org/eps.php?id=1203">HPR1203</a>)</li>
<li>Octopress: <a href="https://octopress.org">https://octopress.org</a></li>
</ul>
<p>
     I settled on octopress for the following reasons:
</p>
<dl>
<dt>SASS</dt>
<dd>
      Sass adds additional functionality to css such as variables, mixins, 
      scopes, and was a tool that I had previously worked with.</dd>
<dt>Twitter Bootstrap</dt>
<dd>
      Twitter bootstrap is a set of templates that produce nice looking 
      pages that are standards compliant, and adaptive so that they look 
      good at any screen resolution. </dd>

<dt>HTML5 Video Plugin</dt>
<dd>
      I ended up creating my own, but Octopress has a HTML5 video plugin.  
      Unfortunately this only supported H264 video, so I created my own to 
      serve H264, Webm, and Ogv.</dd>

<dt>Deployment scripts</dt>
<dd>
      Octopress comes with rsync, and github pages support out of the box, 
      so you can deploy your site with very little effort.</dd>
</dl>
 
<h2>Requirements:</h2>
<ul>
<li>Ruby 1.9.3 or above</li>
<li>Git</li>
<li>HTML knowledge</li>
<li>Text Editor &amp; Terminal</li>
</ul>

<h3>Install Requirements:</h3>
<p>In Ubuntu 12.04 I did the following:</p>

<pre>
sudo apt-get install emacs git zlib1g-dev openssl libopenssl-ruby1.9.1 \
libssl-dev libruby1.9.1 libreadline-dev
</pre>

<h3>Install ruby through rbenv</h3>

<p>rbenv (<a href="https://rbenv.org">https://rbenv.org</a>)</p>
<pre>
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
# set environment in ~/.bash_profile.  Change this to ~/.zshrc if using zshell
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile # You can change to .zshrc or .bashrc
</pre>

<p>Install ruby-build to make installing ruby easy</p>
<pre>
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
</pre>

<p>Install ruby</p>
<pre>
rbenv install 1.9.3-p194
rbenv rehash
</pre>

<h2>Octopress</h2>
<p><a href="https://octopress.org">https://octopress.org</a>
<h3>Install Octopress</h3>
<pre>
git clone git://github.com/imathis/octopress.git octopress
cd octopress
rbenv local 1.9.3-p194  
</pre>

<h3>Install Ruby Requirements</h3>
<pre>
gem install bundler
rbenv rehash
bundle install  
</pre>


<h3>What is rake?</h3>
<p>Rake is like make but for ruby. </p>

<h4>Use rake scripts to setup and preview blog</h4>
<pre>
rake -T # list all available rake tasks
rake install # install themes and default config
rake preview # generate and view site
</pre>

<p>Open localhost:4000 in your webbrowser</p>

<h3>Setup Deployment</h3>
<pre>
rake set_root_dir['blog-test']
rake setup_github_pages 
rake generate
# Change the following url to point to your repository
git remote add origin https://github.com/HarryGuerilla/blog-test.git
git config branch.master.remote origin
git add .
git commit -m "initial commit"
git push origin master
rake deploy # this is where the magic happens
</pre>


<h3>Configure Blog</h3>
<pre>
emacs _config.yml
# Edit title, author, subtitle
</pre>

<h3>Create First Post &amp; Basic workflow:</h3>
<pre>
rake new_post
emacs post
git add .
git commit -m "added new post"
</pre>

<h3>Publish Blog</h3>
<pre>
rake deploy
</pre>