{% if page.headline %}{{ page.headline }}{% else %}{{ pa
By {{ author.name }}
{% if page.modified %}{% endif %}
- {% if (site.owner.disqus-shortname and page.comments) or site.comments %}Comment{% endif %}
+ {% if site.owner.disqus-shortname and page.comments or site.comments %}Comment{% endif %}
{% if page.share %}{% include social-share.html %}{% endif %}
{% if page.ads == true %}{% include ad-sidebar.html %}{% endif %}
{{ content }}
- {% if (site.owner.disqus-shortname and page.comments) or site.comments %}
+ {% if site.owner.disqus-shortname and page.comments or site.comments %}
{% include disqus-comments.html %}
{% endif %}
diff --git a/assets/js/plugins/search.js b/assets/js/plugins/search.js
index 52b13522dce..0c6e4f3a995 100644
--- a/assets/js/plugins/search.js
+++ b/assets/js/plugins/search.js
@@ -12,7 +12,7 @@
========================================================================== */
var q, jsonFeedUrl = "/search.json",
- $searchForm = $(".simple-search"),
+ $searchForm = "[data-search-form]",
$searchInput = $("[data-search-input]"),
$resultTemplate = $("#search-result"),
$resultsPlaceholder = $("[data-search-results]"),
@@ -25,7 +25,7 @@ var q, jsonFeedUrl = "/search.json",
$(document).ready( function() {
-
+
// hide items found string
$foundContainer.hide();
@@ -39,7 +39,7 @@ $(document).ready( function() {
/* ==========================================================================
Search functions
========================================================================== */
-
+
/**
* Initiate search functionality.
@@ -66,7 +66,7 @@ function initSearch() {
/**
* Executes search
- * @param {String} q
+ * @param {String} q
* @return null
*/
function execSearch(q) {
@@ -92,7 +92,7 @@ function toggleLoadingClass() {
/**
* Get Search results from JSON
- * @param {Function} callbackFunction
+ * @param {Function} callbackFunction
* @return null
*/
function getSearchResults(callbackFunction) {
@@ -106,14 +106,14 @@ function getSearchResults(callbackFunction) {
*/
function processData() {
$results = [];
-
+
return function(data) {
-
+
var resultsCount = 0,
results = "";
$.each(data, function(index, item) {
- // check if search term is in content or title
+ // check if search term is in content or title
if (item.excerpt.toLowerCase().indexOf(q.toLowerCase()) > -1 || item.title.toLowerCase().indexOf(q.toLowerCase()) > -1) {
var result = populateResultContent($resultTemplate.html(), item);
resultsCount++;
@@ -144,7 +144,7 @@ function showSearchResults(results) {
/**
* Add results content to item template
- * @param {String} html
+ * @param {String} html
* @param {object} item
* @return {String} Populated HTML
*/
@@ -159,7 +159,7 @@ function populateResultContent(html, item) {
/**
* Populates results string
- * @param {String} count
+ * @param {String} count
* @return null
*/
function populateResultsString(count) {
@@ -178,7 +178,7 @@ function populateResultsString(count) {
/**
* Gets query string parameter - taken from http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
- * @param {String} name
+ * @param {String} name
* @return {String} parameter value
*/
function getParameterByName(name) {
@@ -191,10 +191,10 @@ function getParameterByName(name) {
* Injects content into template using placeholder
* @param {String} originalContent
* @param {String} injection
- * @param {String} placeholder
+ * @param {String} placeholder
* @return {String} injected content
*/
function injectContent(originalContent, injection, placeholder) {
var regex = new RegExp(placeholder, 'g');
return originalContent.replace(regex, injection);
-}
\ No newline at end of file
+}
diff --git a/assets/js/scripts.min.js b/assets/js/scripts.min.js
index 44921b311e5..94a017bc5bd 100644
--- a/assets/js/scripts.min.js
+++ b/assets/js/scripts.min.js
@@ -1,2 +1,2 @@
-function initSearch(){getParameterByName("q")&&(q=decodeURIComponent(getParameterByName("q")),$searchInput.val(q),execSearch(q)),$(document).on("submit",$searchForm,function(a){a.preventDefault(),q=$searchInput.val(),execSearch(q)})}function execSearch(a){(""!=a||allowEmpty)&&(showLoader&&toggleLoadingClass(),getSearchResults(processData()))}function toggleLoadingClass(){$resultsPlaceholder.toggleClass(loadingClass),$foundContainer.toggleClass(loadingClass)}function getSearchResults(a){$.get(BASE_URL+jsonFeedUrl,a,"json")}function processData(){return $results=[],function(a){var b=0,c="";$.each(a,function(a,d){if(d.excerpt.toLowerCase().indexOf(q.toLowerCase())>-1||d.title.toLowerCase().indexOf(q.toLowerCase())>-1){var e=populateResultContent($resultTemplate.html(),d);b++,c+=e}}),showLoader&&toggleLoadingClass(),populateResultsString(b),showSearchResults(c)}}function showSearchResults(a){$resultsPlaceholder.html(a)}function populateResultContent(a,b){return a=injectContent(a,b.title,"##Title##"),a=injectContent(a,b.link,"##Url##"),a=injectContent(a,b.excerpt,"##Excerpt##"),a=injectContent(a,b.date,"##Date##")}function populateResultsString(a){$foundTerm.text(q),$foundCount.text(a),$foundContainer.show()}function getParameterByName(a){var b=RegExp("[?&]"+a+"=([^&]*)").exec(window.location.search);return b&&decodeURIComponent(b[1].replace(/\+/g," "))}function injectContent(a,b,c){var d=new RegExp(c,"g");return a.replace(d,b)}!function(a){"use strict";a.fn.fitVids=function(b){var c={customSelector:null};if(!document.getElementById("fit-vids-style")){var d=document.createElement("div"),e=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0],f="";d.className="fit-vids-style",d.id="fit-vids-style",d.style.display="none",d.innerHTML=f,e.parentNode.insertBefore(d,e)}return b&&a.extend(c,b),this.each(function(){var b=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];c.customSelector&&b.push(c.customSelector);var d=a(this).find(b.join(","));d=d.not("object object"),d.each(function(){var b=a(this);if(!("embed"===this.tagName.toLowerCase()&&b.parent("object").length||b.parent(".fluid-width-video-wrapper").length)){var c="object"===this.tagName.toLowerCase()||b.attr("height")&&!isNaN(parseInt(b.attr("height"),10))?parseInt(b.attr("height"),10):b.height(),d=isNaN(parseInt(b.attr("width"),10))?b.width():parseInt(b.attr("width"),10),e=c/d;if(!b.attr("id")){var f="fitvid"+Math.floor(999999*Math.random());b.attr("id",f)}b.wrap('').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),b.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto),function(a){var b,c,d,e,f,g,h,i="Close",j="BeforeClose",k="AfterClose",l="BeforeAppend",m="MarkupParse",n="Open",o="Change",p="mfp",q="."+p,r="mfp-ready",s="mfp-removing",t="mfp-prevent-close",u=function(){},v=!!window.jQuery,w=a(window),x=function(a,c){b.ev.on(p+a+q,c)},y=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},z=function(c,d){b.ev.triggerHandler(p+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},A=function(c){return c===h&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),h=c),b.currTemplate.closeBtn},B=function(){a.magnificPopup.instance||(b=new u,b.init(),a.magnificPopup.instance=b)},C=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};u.prototype={constructor:u,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=C(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),e=a(document),b.popupsCache={}},open:function(c){d||(d=a(document.body));var f;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var h,i=c.items;for(f=0;f(a||w.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),z(m,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(q+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith(''):d.attr(e[1],c)}}else b.find(q+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.id="mfp-sbm",a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:u.prototype,modules:[],open:function(b,c){return B(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(c){B();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=v?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),v?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var D,E,F,G="inline",H=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(G,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(G),x(i+"."+G,function(){H()})},getInline:function(c,d){if(H(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(E||(D=e.hiddenClass,E=y(D),D="mfp-"+D),F=f.after(E).detach().removeClass(D)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("
");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var I,J="ajax",K=function(){I&&d.removeClass(I)},L=function(){K(),b.req&&b.req.abort()};a.magnificPopup.registerModule(J,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){b.types.push(J),I=b.st.ajax.cursor,x(i+"."+J,L),x("BeforeChange."+J,L)},getAjax:function(c){I&&d.addClass(I),b.updateStatus("loading");var e=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};z("ParseAjax",g),b.appendContent(a(g.data),J),c.finished=!0,K(),b._setFocus(),setTimeout(function(){b.wrap.addClass(r)},16),b.updateStatus("ready"),z("AjaxContentAdded")},error:function(){K(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(e),""}}});var M,N=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'