From 29a053cca925ac8d7c6f36c4a08fed22c6727e7b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 24 Feb 2012 19:01:14 +0000 Subject: [PATCH] cleanly format html output --- app.js | 4 +++- src/app.coffee | 2 +- views/ga.coffee | 12 +++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 1da82cb..279acce 100644 --- a/app.js +++ b/app.js @@ -29,7 +29,9 @@ }); app.get('/', function(req, res) { - return res.render('index'); + return res.render('index', { + format: true + }); }); app.listen(process.env.PORT || 3000); diff --git a/src/app.coffee b/src/app.coffee index c549642..1b0f30a 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -23,7 +23,7 @@ app.configure 'production', -> # Routes app.get '/', (req, res) -> - res.render 'index' + res.render 'index', format: true # Set port and start server. diff --git a/views/ga.coffee b/views/ga.coffee index 5671689..e01970f 100644 --- a/views/ga.coffee +++ b/views/ga.coffee @@ -1,3 +1,13 @@ script ''' - var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-354018-12']); _gaq.push(['_trackPageview']); (function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-354018-12']); + _gaq.push(['_trackPageview']); + (function() { + var ga = document.createElement('script'); + ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + ''' \ No newline at end of file