How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| /* | |
| * object.watch polyfill | |
| * | |
| * 2012-04-03 | |
| * | |
| * By Eli Grey, http://eligrey.com | |
| * Public Domain. | |
| * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
| */ |
| <?php | |
| /* From https://www.usps.com/send/official-abbreviations.htm */ | |
| $us_state_abbrevs_names = array( | |
| 'AL'=>'ALABAMA', | |
| 'AK'=>'ALASKA', | |
| 'AS'=>'AMERICAN SAMOA', | |
| 'AZ'=>'ARIZONA', | |
| 'AR'=>'ARKANSAS', |
| // polyfill window.getMatchedCSSRules() in FireFox 6+ | |
| if ( typeof window.getMatchedCSSRules !== 'function' ) { | |
| var ELEMENT_RE = /[\w-]+/g, | |
| ID_RE = /#[\w-]+/g, | |
| CLASS_RE = /\.[\w-]+/g, | |
| ATTR_RE = /\[[^\]]+\]/g, | |
| // :not() pseudo-class does not add to specificity, but its content does as if it was outside it | |
| PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g, | |
| PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g; | |
| // convert an array-like object to array |
| // polyfill window.getMatchedCSSRules() in FireFox 6+ | |
| if ( typeof window.getMatchedCSSRules !== 'function' ) { | |
| var ELEMENT_RE = /[\w-]+/g, | |
| ID_RE = /#[\w-]+/g, | |
| CLASS_RE = /\.[\w-]+/g, | |
| ATTR_RE = /\[[^\]]+\]/g, | |
| // :not() pseudo-class does not add to specificity, but its content does as if it was outside it | |
| PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g, | |
| PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g; | |
| // convert an array-like object to array |
| var arr = { | |
| max: function(array) { | |
| return Math.max.apply(null, array); | |
| }, | |
| min: function(array) { | |
| return Math.min.apply(null, array); | |
| }, | |
| range: function(array) { |
| <?php | |
| chdir(dirname(__FILE__)); | |
| require_once '../app/Mage.php'; | |
| Mage::app(); | |
| umask(0); | |
| $productModel = Mage::getModel('Mage_Catalog_Model_Product'); | |
| $categoryModel = Mage::getModel('Mage_Catalog_Model_Category'); |
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "net" | |
| "net/http" | |
| "strings" | |
| ) |
| Snap.plugin(function (Snap, Element, Paper, glob, Fragment) { | |
| var elproto = Element.prototype; | |
| elproto.animateAlongPath = function (path, el, start, duration, easing) { | |
| var callback = this; | |
| el.transform('t0,0'); | |
| var len = Snap.path.getTotalLength(path), | |
| elBB = el.getBBox(), | |
| elCenter = { | |
| x: elBB.x + (elBB.width / 2), | |
| y: elBB.y + (elBB.height / 2), |
| # .editorconfig (not found) |