From 8e7c98c0129a0960e079f3b5d762d5b6fefd26c6 Mon Sep 17 00:00:00 2001 From: Glen Cheney Date: Fri, 26 Jul 2013 17:25:42 -0700 Subject: [PATCH] Add absolute urls to open graph and twitter cards. Added dev yml config file. Only include analytics in production environment. --- README.md | 7 ++++++- _config.yml | 12 ++++++++---- _config_dev.yml | 6 ++++++ _includes/head.html | 7 +++---- _includes/scripts.html | 28 ++++++++++++++++++++++++++++ img/{hero.png => shuffle.png} | Bin js/page.js | 26 -------------------------- 7 files changed, 51 insertions(+), 35 deletions(-) create mode 100644 _config_dev.yml rename img/{hero.png => shuffle.png} (100%) diff --git a/README.md b/README.md index 50fb016..f7b825c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,12 @@ Categorize, sort, and filter a responsive grid of items This is a large improvement to shuffle. Most notably, the ability for [masonry](http://masonry.desandro.com) layouts. Other additions include adding/removing items, enabling/disabling, multiple instances on a page, and more! ## Running locally -This project uses [Jekyll](http://jekyllrb.com/), so head over to [their quickstart guide](http://jekyllrb.com/docs/quickstart/) to get set up. You should then be able to run `jekyll serve --watch` and go to `http://localhost:4000/Shuffle` to see it. +This project uses [Jekyll](http://jekyllrb.com/), so: +* head over to [their quickstart guide](http://jekyllrb.com/docs/quickstart/) to setup jekyll. +* run `jekyll serve --watch --config _config.yml,_config_dev.yml` in your console +* go to `http://localhost:4000` to see it. + +The `--config` option can take multiple config files. In this case, the `_config_dev.yml` file overrides options set in `_config.yml`. ## Improvements still to make * Use Deferred objects for callbacks diff --git a/_config.yml b/_config.yml index 429939e..ff32e5d 100644 --- a/_config.yml +++ b/_config.yml @@ -7,14 +7,18 @@ exclude: ['./_scss/*.*'] permalink: /:title -# url: http://glen.local:4000 -# url: http://localhost:4000 -# url: http://vestride.github.io/Shuffle +# Overriden in _config_dev.yml +environment: production + +# Open graph and twitter cards require absolute urls +url: http://vestride.github.io + +# jekyll serve --watch --config _config.yml,_config_dev.yml baseurl: /Shuffle defaultTitle: 'Shuffle.js' defaultDescription: 'Categorize, sort, and filter a responsive grid of items' -defaultImage: '/img/hero.png' +defaultImage: '/img/shuffle.png' longDescription: 'Shuffle.js is a jQuery plugin for sorting, filtering, and laying out a group of items. It’s performant, responsive, and fast. Check out the demos!' diff --git a/_config_dev.yml b/_config_dev.yml new file mode 100644 index 0000000..c571593 --- /dev/null +++ b/_config_dev.yml @@ -0,0 +1,6 @@ + +# Options in this file override ones set in _config.yml + +environment: "development" +url: http://localhost:4000 +baseurl: "" \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 5627ed8..9ab9d7b 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -9,12 +9,11 @@ {% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ site.defaultDescription }}{% endif %}{% endcapture %} {% capture image %}{% if page.image %}{{ page.image }}{% else %}{{ site.defaultImage }}{% endif %}{% endcapture %} - - - + + @@ -22,7 +21,7 @@ - + diff --git a/_includes/scripts.html b/_includes/scripts.html index c19fd83..8d1c613 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -20,4 +20,32 @@ {% for src in page.extraJS %} {% endfor %} +{% endif %} + +{% if site.environment == "production" %} + {% endif %} \ No newline at end of file diff --git a/img/hero.png b/img/shuffle.png similarity index 100% rename from img/hero.png rename to img/shuffle.png diff --git a/js/page.js b/js/page.js index f13f492..779dcf7 100644 --- a/js/page.js +++ b/js/page.js @@ -366,32 +366,6 @@ Modules.Favicon = (function( doc ) { }( document )); - -// Analytics -var _gaq = [ ['_setAccount', 'UA-39355642-1'], ['_trackPageview'] ]; - -(function(doc, script) { - 'use strict'; - - var js, - fjs = doc.scripts[0], - frag = doc.createDocumentFragment(), - add = function(url, id) { - if (doc.getElementById(id)) {return;} - js = doc.createElement(script); - js.src = url; - if ( id ) { js.id = id; } - frag.appendChild( js ); - }; - - // Load GA over http, we know it won't be over ssl - add('//www.google-analytics.com/ga.js'); - - fjs.parentNode.insertBefore(frag, fjs); - -}(document, 'script')); - - $(document).ready(function() { 'use strict';