<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <title type="text">Ryan Daigle</title>
  <generator uri="http://effectif.com/nesta">Nesta</generator>
  <id>tag:www.ryandaigle.com,2009:/</id>
  
  <link href="http://www.ryandaigle.com" rel="alternate" />
  <subtitle type="text">Insert pithy wittiness here</subtitle>
  <updated>2012-02-22T00:00:00+00:00</updated>
  <author>
    <name>Ryan Daigle</name>
    <uri>http://ryandaigle.com</uri>
    <email>ryan.daigle@gmail.com</email>
  </author>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/RyansScraps" /><feedburner:info uri="ryansscraps" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>37.544746</geo:lat><geo:long>-77.400851</geo:long><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><entry>
    <title>Deploying a Nesta CMS Blog with Pygments Syntax Highlighting to Heroku</title>
    <link href="http://feedproxy.google.com/~r/RyansScraps/~3/BVkPVWnZkFg/deploying-nesta-cms-blog-heroku-cedar-pygments-syntax-highlighting" rel="alternate" type="text/html" />
    <id>tag:www.ryandaigle.com,2012-02-22:/a/deploying-nesta-cms-blog-heroku-cedar-pygments-syntax-highlighting</id>
    <content type="html">
      &lt;p&gt;Blogging and/or setting up a simple site should be a simple proposition. There are a lot of great frameworks out there that handle the software portion of running such a site. However, you don&amp;#8217;t just want a stock setup. You have to take into account proper asset caching for performance, slick syntax highlighting, an aesthetically pleasing theme, app instrumentation, feed redirection and production deployment.&lt;/p&gt;
      
      &lt;p&gt;I&amp;#8217;ve gone ahead and boiled down all these concerns into just a few steps based on the &lt;a href='http://nestacms.com'&gt;Nesta CMS&lt;/a&gt; framework.&lt;/p&gt;
      &lt;p class='note'&gt;
      If you're not much for foreplay a fully deployable starter template of this site can be found &lt;a href='http://github.com/rwdaigle/nesta-app-template'&gt;here on GitHub&lt;/a&gt; and seen running &lt;a href='http://nesta-app-template.herokuapp.com/'&gt;here on Heroku&lt;/a&gt;.
      &lt;/p&gt;
      &lt;h2 id='background'&gt;Background&lt;/h2&gt;
      
      &lt;p&gt;Having wrestled with quite a few blogging engines in the past I had several requirements of a new setup. Firstly it had to support a workflow that lets me write on my local machine using the tools I prefer, namely &lt;a href='http://daringfireball.net/projects/markdown/'&gt;markdown formatted articles&lt;/a&gt; composed with &lt;a href='http://www.iawriter.com/'&gt;IA Writer&lt;/a&gt; or a basic text editor.&lt;/p&gt;
      
      &lt;p&gt;Second, it had to support a git-based workflow. My content is going to live in git and there&amp;#8217;s no reason the publishing platform shouldn&amp;#8217;t build on top of that as well. This also plays well with &lt;a href='http://heroku.com'&gt;Heroku&lt;/a&gt; deployments.&lt;/p&gt;
      
      &lt;p&gt;Static site generators are all the rage and fulfill the first two requirements. However, I&amp;#8217;ve found them to be rather rigid and obtrusive for the very incremental edit-view-edit workflow I assume when writing. My last requirement was that I could write and immediately refresh my browser to see the fully rendered site running locally. Waiting for the whole site to generate on every minor edit proved to be far too slow for me in the past.&lt;/p&gt;
      
      &lt;p&gt;Fortunately, there&amp;#8217;s a better way.&lt;/p&gt;
      
      &lt;h2 id='landscape'&gt;Landscape&lt;/h2&gt;
      
      &lt;p&gt;The list of dynamic file-backed Heroku-friendly blog engines isn&amp;#8217;t particularly long. I investigated both &lt;a href='http://cloudhead.io/toto'&gt;Toto&lt;/a&gt; and &lt;a href='http://nestacms.com/'&gt;Nesta CMS&lt;/a&gt; and, after a brief wrestle trying to get Toto&amp;#8217;s HTTP request headers to play nice with rack-cache, settled on Nesta. Nesta is under active development and is written with Sinatra, the very simple and hackable web framework for Ruby.&lt;/p&gt;
      
      &lt;p&gt;For deployment &lt;a href='http://heroku.com'&gt;Heroku&lt;/a&gt; is the obvious choice given its seamless git-based workflow and variety of &lt;a href='http://addons.heroku.com'&gt;add-ons&lt;/a&gt;. I also work there.&lt;/p&gt;
      &lt;p class='note'&gt;
      These steps assume you have &lt;a href='http://git-scm.com/'&gt;git&lt;/a&gt; and &lt;a href='http://www.ruby-lang.org/en/'&gt;ruby&lt;/a&gt; available from the command line and have already signed up for a &lt;a href='https://api.heroku.com/signup'&gt;Heroku account&lt;/a&gt;. The &lt;a href='http://toolbelt.heroku.com/'&gt;Heroku Toolbelt&lt;/a&gt; can get you up and running if you're missing any components.
      &lt;/p&gt;
      &lt;h2 id='template'&gt;Template&lt;/h2&gt;
      
      &lt;p&gt;Though the &lt;a href='http://nestacms.com/docs/quick-start'&gt;Nesta quick-start&lt;/a&gt; is solid, as are all their docs, we can skip ahead by using an app template. I&amp;#8217;ve created one &lt;a href='https://github.com/rwdaigle/nesta-app-template'&gt;on github&lt;/a&gt; that&amp;#8217;s already setup for syntax highlighting with &lt;a href='http://pygments.org/'&gt;Pygments&lt;/a&gt;, the &lt;a href='https://github.com/rwdaigle/nesta-theme-clean'&gt;&amp;#8220;clean&amp;#8221; theme&lt;/a&gt; you see running this site and the minimal artefacts needed to quickly deploy and provision a full-featured Heroku app.&lt;/p&gt;
      
      &lt;p&gt;Fork the starter template using the &amp;#8220;Fork&amp;#8221; button on the &lt;a href='https://github.com/rwdaigle/nesta-app-template'&gt;template GitHub page&lt;/a&gt;.&lt;/p&gt;
      
      &lt;p&gt;&lt;img alt='Fork starter template screenshot' src='http://f.cl.ly/items/2g1E2H1n0X0T3y0v3S2K/Screen%20Shot%202012-02-22%20at%207.43.19%20PM.png' /&gt;&lt;/p&gt;
      
      &lt;p&gt;This will fork it to your GitHub account. From there you can clone your fork locally. Find the repository URL for your fork and copy it (your URL will differ from the one shown below).&lt;/p&gt;
      
      &lt;p&gt;&lt;img alt='Repository URL screenshot' src='http://f.cl.ly/items/163a0t1n3w0D282v3v25/repo-url.png' /&gt;&lt;/p&gt;
      
      &lt;p&gt;Clone the app template to your local environment using &lt;code&gt;git&lt;/code&gt;. Use the domain name of your site instead of &lt;code&gt;mysite.com&lt;/code&gt;&lt;/p&gt;
      &lt;pre lang='bash'&gt;&lt;code&gt;&amp;#x000A;$ git clone git@github.com:rwdaigle/nesta-app-template.git mysite.com&amp;#x000A;Cloning into mysite.com...&amp;#x000A;remote: Counting objects: 72, done.&amp;#x000A;remote: Compressing objects: 100% (38/38), done.&amp;#x000A;remote: Total 72 (delta 29), reused 63 (delta 20)&amp;#x000A;Receiving objects: 100% (72/72), 11.69 KiB, done.&amp;#x000A;Resolving deltas: 100% (29/29), done.&amp;#x000A;&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;The application&amp;#8217;s source is now installed locally in the &lt;code&gt;mysite.com&lt;/code&gt; directory.&lt;/p&gt;
      
      &lt;h2 id='run'&gt;Run&lt;/h2&gt;
      
      &lt;p&gt;Now that the site template is present in the local environment you can install required dependencies and render the site locally before deploying to a remote server environment. A &lt;code&gt;bootstrap.sh&lt;/code&gt; script is provided for your convenience.&lt;/p&gt;
      &lt;div class='note'&gt;
      The &lt;code&gt;bootstrap.sh&lt;/code&gt; script does not use sudo or make any destructive commands. However, please review the script source before executing.
      &lt;/div&gt;&lt;pre lang='bash'&gt;&lt;code&gt;&amp;#x000A;$ cat bootstrap.sh&amp;#x000A;$ ./bootstrap.sh &amp;#x000A;Using RedCloth (4.2.9) &amp;#x000A;Using addressable (2.2.7) &amp;#x000A;# ...&amp;#x000A;Submodule path 'themes/clean': checked out '889e094749008d2bf4ecf901555fce44c7f7bc87'&amp;#x000A;&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;Once bootstrap has finished start the app using the &lt;code&gt;foreman&lt;/code&gt; utility.&lt;/p&gt;
      &lt;pre lang='bash'&gt;&lt;code&gt;&amp;#x000A;$ foreman start&amp;#x000A;14:25:47 web.1     | started with pid 59647&amp;#x000A;&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;Opening &lt;a href='http://localhost:5000'&gt;http://localhost:5000&lt;/a&gt; should display the site running with a single getting started article listed on the home page. Any errors that occur will be shown in the terminal where you entered the &lt;code&gt;foreman start&lt;/code&gt; command.&lt;/p&gt;
      
      &lt;h2 id='deploy'&gt;Deploy&lt;/h2&gt;
      
      &lt;p&gt;Assuming you have a Heroku account and have successfully installed the &lt;a href='http://toolbelt.heroku.com'&gt;Heroku Toolbelt&lt;/a&gt; you can use the provided helper script to quickly deploy the site install any dependencies and setup the appropriate configuration.&lt;/p&gt;
      &lt;div class='note'&gt;
      The app deployed to Heroku will not incur any charges on Heroku.
      &lt;/div&gt;&lt;pre lang='bash'&gt;&lt;code&gt;&amp;#x000A;$ cat deploy.sh&amp;#x000A;# ... review script source ...&amp;#x000A;&amp;#x000A;$ ./deploy.sh &amp;#x000A;Creating vivid-sword-9170... done, stack is cedar&amp;#x000A;Adding memcache to vivid-sword-9170... done&amp;#x000A;# ...&amp;#x000A;Opening http://vivid-sword-9170.herokuapp.com/&amp;#x000A;&lt;/code&gt;&lt;/pre&gt;
      &lt;h2 id='next'&gt;Next&lt;/h2&gt;
      
      &lt;p&gt;You&amp;#8217;ve forked your own copy of the app template, got it running locally and deployed it for free to Heroku. Not bad for a few minutes of your time! To customize the site, setup analytics and write your first post go ahead and read the welcome post included in your new site (a copy can be found &lt;a href='http://nesta-app-template.herokuapp.com/welcome'&gt;here&lt;/a&gt;).&lt;/p&gt;
      
      &lt;p&gt;&lt;img alt='Welcome post screenshot' src='http://cl.ly/ESq1/Screen%20Shot%202012-02-22%20at%207.57.40%20PM.png' /&gt;&lt;/p&gt;
      
      &lt;p&gt;My hope is this template and theme eliminates many of the sticking points associated with taking a great framework like Nesta and turning it into a running, usable and deployed site. Let me know if you run into any issues (or better yet, submit a pull request to the template or theme projects on GitHub).&lt;/p&gt;
    
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gTl782lpgHOpVyeoWIEDzyItDrI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gTl782lpgHOpVyeoWIEDzyItDrI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gTl782lpgHOpVyeoWIEDzyItDrI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gTl782lpgHOpVyeoWIEDzyItDrI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=BVkPVWnZkFg:-1F7rBGTwXw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=BVkPVWnZkFg:-1F7rBGTwXw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=BVkPVWnZkFg:-1F7rBGTwXw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=BVkPVWnZkFg:-1F7rBGTwXw:I2FUP0JpNAM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?i=BVkPVWnZkFg:-1F7rBGTwXw:I2FUP0JpNAM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=BVkPVWnZkFg:-1F7rBGTwXw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RyansScraps/~4/BVkPVWnZkFg" height="1" width="1"/&gt;</content>
    <published>2012-02-22T00:00:00+00:00</published>
    <updated>2012-02-22T00:00:00+00:00</updated>
  <feedburner:origLink>http://www.ryandaigle.com/a/deploying-nesta-cms-blog-heroku-cedar-pygments-syntax-highlighting</feedburner:origLink></entry>
  <entry>
    <title>Site Relaunch</title>
    <link href="http://feedproxy.google.com/~r/RyansScraps/~3/NbBh_o9aBHs/relaunch" rel="alternate" type="text/html" />
    <id>tag:www.ryandaigle.com,2012-02-08:/a/relaunch</id>
    <content type="html">
      &lt;p&gt;I&amp;#8217;m currently in the middle of putting a fresh coat of paint on RyanDaigle.com, the previous home of the &lt;a href='http://edgerails.info'&gt;What&amp;#8217;s new in Edge Rails&lt;/a&gt; series. All old links to http://ryandaigle.com/articles will be redirected to an archived version of the site at &lt;a href='http://archives.ryandaigle.com'&gt;http://archives.ryandaigle.com&lt;/a&gt;. I doubt all links will make the change, but I&amp;#8217;ve given it my best effort.&lt;/p&gt;
      
      &lt;p&gt;Don&amp;#8217;t have any big plans for the site beyond a renewed effort at writing more. Stay tuned.&lt;/p&gt;
    
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iX_R7VAjvZ3HqS2blb4lXqbvNI8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iX_R7VAjvZ3HqS2blb4lXqbvNI8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iX_R7VAjvZ3HqS2blb4lXqbvNI8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iX_R7VAjvZ3HqS2blb4lXqbvNI8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=NbBh_o9aBHs:wXsWPsiWQ1k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=NbBh_o9aBHs:wXsWPsiWQ1k:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=NbBh_o9aBHs:wXsWPsiWQ1k:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/RyansScraps?a=NbBh_o9aBHs:wXsWPsiWQ1k:I2FUP0JpNAM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/RyansScraps?i=NbBh_o9aBHs:wXsWPsiWQ1k:I2FUP0JpNAM" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RyansScraps/~4/NbBh_o9aBHs" height="1" width="1"/&gt;</content>
    <published>2012-02-08T00:00:00+00:00</published>
    <updated>2012-02-08T00:00:00+00:00</updated>
  <feedburner:origLink>http://www.ryandaigle.com/a/relaunch</feedburner:origLink></entry>
</feed>

