Go to the local directory where your site was cloned and open the
.env file. Edit the configuration values for your site and third-party services (Google analytics, FeedBurner, Disqus, Twitter, GitHub, LinkedIn etc…). For reference my site’s
.env file looks like this:
RACK_ENV=development NESTA_TITLE="Ryan Daigle" NESTA_FEED_URL=http://feeds.feedburner.com/RyansScraps NESTA_AUTHOR__NAME=Ryan Daigle NESTA_AUTHOR__EMAILfirstname.lastname@example.org NESTA_AUTHOR__URI=http://ryandaigle.com NESTA_AUTHOR__TWITTER=rwdaigle NESTA_AUTHOR__GITHUB=rwdaigle NESTA_AUTHOR__LINKEDIN=rwdaigle NESTA_THEME=clean NESTA_POWERED_BY=true NESTA_CACHE=false NESTA_CONTENT=content NESTA_DISQUS_SHORT_NAME=ryandaiglecom NESTA_PRODUCTION__GOOGLE_ANALYTICS_CODE=UA-77805-8 GAUGES_SITE_ID=123456789
NESTA_TITLEvalue are ugly when rendered locally, they are necessary for any value with spaces when transferring the environment to Heroku or using the Heroku CLI.
Updating the site on Heroku with new configuration variables can be accomplished with this command:
$ cat .env | grep -v 'RACK_ENV' | tr '\n' ' ' | xargs heroku config:add
You can eploy to your site on Heroku just as you would any Heroku site with a
git push heroku master after committing any changes to the git repository. This includes any new articles or content updates you make.
$ git add . $ git commit -m "Updates" $ git push heroku master
Please see Nesta CMS’s instructions for writing articles to add pages and new posts to your site.
Since your site is a fork of the app template any updates to either the theme or the template itself can be easily merged into your site. The template ships with an update script that does this automatically. Execute the following starting in your site’s local root directory:
All the script does is pull in the latest changes to an
upstream branch and rebase against it. It commits any local changes first to minimize conflicts. If you’re comfortable managing this process yourself please feel free to do so as the script is provided for convenience only.
def greeting 'Hello World!' end
var request = require('request'), fs = require('fs'), spawn = require('child_process').spawn, Hash = require('hashish');; var version = JSON.parse(fs.readFileSync('package.json','utf8')).version;
$ curl "http://gist.github.com/raw/13212qw" > test.txt
While there’s support for Google Analytics built into the site template and theme (configurable by editing the
.env file) I would recommend taking a look at Gauges instead. It is a much more clean and concise way to measure your site’s traffic, visitors and general analytics and has native iPhone and Android apps.
To update your site to send statistics to Gauges simply set the
GAUGES_SITE_ID configuration variable on Heroku.
$ heroku config:add GAUGES_SITE_ID=12345678 Adding config vars and restarting app... done, v72 GAUGES_SITE_ID => 12345678
New Relic, available for free on Heroku, is an incredibly useful tool for understanding how your site is operating, what kind of performance it’s getting and where any bottlenecks are.
The app template’s
deploy.sh script automatically sets up the New Relic add-on. Open up the New Relic dashboard using the
heroku addons:open command.
$ heroku addons:open newrelic
By default the site will cache pages and assets (images, css, js) for one hour. This improves the performance of the site while still allowing a reasonable level of freshness. If your site is like most blogs, this number can be greatly increased since the content rarely changes. To change your site settings to cache assets for 12 hours run the
heroku config:add command setting
DEFAULT_TTL to the number of seconds.
$ heroku config:add DEFAULT_TTL=43200 Adding config vars and restarting app... done, v72 DEFAULT_TTL => 43200
Please see Heroku’s custom domain instructions to setup your own domain pointing to the site.