diff --git a/Gemfile b/Gemfile index 7b69d8732ccf3..fbef792df60eb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem 'jekyll', '~> 4.0.0' +gem 'jekyll', '~> 4.1', '>= 4.1.1' gem 'bundler' gem 'kramdown' gem 'rack-jekyll' @@ -16,12 +16,10 @@ gem 'puma' group :jekyll_plugins do gem 'devlopr', '~> 0.4.5' gem 'jgd', '~> 1.12' - gem 'jekyll-feed', '~> 0.13.0' gem 'jekyll-paginate', '~> 1.1.0' gem 'jekyll-gist', '~> 1.5.0' gem 'jekyll-seo-tag', '~> 2.6.1' gem 'jekyll-sitemap', '~> 1.4.0' - gem 'jekyll-algolia', '~> 1.6' gem 'jekyll-menus', '~> 0.6.1' gem 'jekyll-admin', '~> 0.10.2' end diff --git a/Gemfile.lock b/Gemfile.lock index 0d5a9ae2a95ca..9e6c0487dc2f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,15 +3,9 @@ GEM specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - algolia_html_extractor (2.6.2) - json (~> 2.0) - nokogiri (~> 1.10.4) - algoliasearch (1.27.3) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - backports (3.18.1) + backports (3.18.2) colorator (1.1.0) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) devlopr (0.4.5) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.13.0) @@ -28,23 +22,21 @@ GEM multipart-post (>= 1.2, < 3) ffi (1.13.1) ffi (1.13.1-x64-mingw32) - filesize (0.2.0) forwardable-extended (2.6.0) http_parser.rb (0.6.0) - httpclient (2.8.3) i18n (1.8.5) concurrent-ruby (~> 1.0) - jekyll (4.0.1) + jekyll (4.1.1) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) - i18n (>= 0.9.5, < 2) + i18n (~> 1.0) jekyll-sass-converter (~> 2.0) jekyll-watch (~> 2.0) kramdown (~> 2.1) kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.3.3) + mercenary (~> 0.4.0) pathutil (~> 0.9) rouge (~> 3.0) safe_yaml (~> 1.0) @@ -53,15 +45,6 @@ GEM jekyll (>= 3.7, < 5.0) sinatra (~> 1.4) sinatra-contrib (~> 1.4) - jekyll-algolia (1.6.0) - algolia_html_extractor (~> 2.6) - algoliasearch (~> 1.26) - filesize (~> 0.1) - jekyll (>= 3.6, < 5.0) - json (~> 2.0) - nokogiri (~> 1.6) - progressbar (~> 1.9) - verbal_expressions (~> 0.1.5) jekyll-feed (0.13.0) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) @@ -80,7 +63,6 @@ GEM jgd (1.12) jekyll (>= 1.5.1) trollop (= 2.9.9) - json (2.3.1) kramdown (2.3.0) rexml kramdown-parser-gfm (1.1.0) @@ -89,21 +71,15 @@ GEM listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - mini_portile2 (2.4.0) + mercenary (0.4.0) multi_json (1.15.0) multipart-post (2.1.1) nio4r (2.5.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - nokogiri (1.10.10-x64-mingw32) - mini_portile2 (~> 2.4.0) octokit (4.18.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - progressbar (1.10.1) public_suffix (4.0.5) puma (4.3.5) nio4r (~> 2.0) @@ -121,7 +97,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.4) - rouge (3.21.0) + rouge (3.22.0) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -151,7 +127,6 @@ GEM tzinfo-data (1.2020.1) tzinfo (>= 1.0.0) unicode-display_width (1.7.0) - verbal_expressions (0.1.5) wdm (0.1.1) PLATFORMS @@ -161,10 +136,8 @@ PLATFORMS DEPENDENCIES bundler devlopr (~> 0.4.5) - jekyll (~> 4.0.0) + jekyll (~> 4.1, >= 4.1.1) jekyll-admin (~> 0.10.2) - jekyll-algolia (~> 1.6) - jekyll-feed (~> 0.13.0) jekyll-gist (~> 1.5.0) jekyll-menus (~> 0.6.1) jekyll-paginate (~> 1.1.0) diff --git a/README.md b/README.md index 912acd316dd2d..504a05226d2c3 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,15 @@ ![](https://ruby-gem-downloads-badge.herokuapp.com/devlopr?type=total&color=brightgreen&style=plastic) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) -Just a little something I'm using to jump start a site refresh. I like to think of it as a starter for building your own Jekyll site. I purposely keep the styling minimal and bare to make it easier to add your own flare and markup. -The Theme supports both Light and Dark Style. Highly Customizable and No Hosting or Maintainence Cost is required ! +Just a little something I'm using to jump start a site refresh. I like to think of it as a starter for building your own Jekyll site. I purposely keep the styling minimal and bare to make it easier to add your own flare and markup. (Under Active Development) ! + +Highly Customizable and No Hosting or Maintainence Cost is required ! ### [Installation Guide](https://devlopr.netlify.app/get-started) ![devlopr jekyll](https://github.com/sujaykundu777/devlopr-jekyll/blob/master/assets/img/screenshot.PNG?raw=true) -devlopr uses Markdown Files to create data like Blog Posts, Gallery, Shop Products etc. No external database is required. +devlopr uses Markdown Files to generate data like Blog Posts, Gallery, Shop Products etc. No external database is required. ### Deploy your devlopr-jekyll blog - One Click Deploy @@ -37,7 +38,7 @@ devlopr uses Markdown Files to create data like Blog Posts, Gallery, Shop Produc - Stylesheet built using Sass - Comments using [Hyvor](https://talk.hyvor.com/) and [Disqus](https://disqus.com/) - SEO-optimized -- Real Time Search using [Algolia](https://algolia.com/) +- Real Time Search - Sell Stuff (Ecommerce) in your Blog using [Snipcart](https://snipcart.com/) - Send Newsletters using [Mailchimp](https://mailchimp.com/) - Contact Forms using [Formspree](https://formspree.io/) @@ -50,17 +51,14 @@ You can easily manage the site locally using the Jekyll admin : [http://localhos ![Jekyll Admin](https://github.com/sujaykundu777/devlopr-jekyll/blob/master/assets/img/jekyll-admin.PNG?raw=true) -#### Search Configuration - -Replace *_algolia_api_key* content with your algolia's app Admin API key and run to index blog posts: - -`jekyll algolia` - -For more info : [Docs here](https://sujaykundu.com/jekyll/2020/06/18/how-to-add-realtime-search-to-your-devlopr-jekyll-blog-using-jekyll-algolia/) +## Recent Release Changes (v 0.4.6): -## Release Changes : +- Minor Bug fixes and optimizations +- You can use Editorial workflow while using Netlify CMS (Draft, Preview, Publish) ! +- Removed Algolia, Now supporting real time search without anythird party ! +- Removed Jekyll Feeds plugin to optimize build time (now uses auto feed generation) ! -You can check out the info on latest changes [here](https://www.buymeacoffee.com/p/57109) +You can check out for all changelogs [here](https://www.buymeacoffee.com/p/57109) ## Pull the latest changes diff --git a/_algolia_api_key b/_algolia_api_key deleted file mode 100644 index aef6ad374f795..0000000000000 --- a/_algolia_api_key +++ /dev/null @@ -1 +0,0 @@ -ad117c961de8b4c86bd24a59b4f72e9f \ No newline at end of file diff --git a/_config.yml b/_config.yml index 1b2a7facf8c85..db3e256293511 100644 --- a/_config.yml +++ b/_config.yml @@ -1,7 +1,7 @@ title: devlopr subtitle: A Jekyll Theme Built for Developers description: >- # this means to ignore newlines until "baseurl:" - devlopr-jekyll is a Jekyll Theme Built For Developers + devlopr-jekyll is a beautiful Jekyll Theme Built For Developers, which is optimized for speed and readability. url: "" # the base hostname & protocol for your site, e.g. https://example.github.io baseurl: "" # the subpath of your site, e.g. /blog @@ -102,14 +102,6 @@ show_author_work_experiences: true show_author_education_details: true show_author_project_details: true -# algolia search -algolia: - application_id: D9WA1YKTRQ - index_name: blog_posts # You can replace that with whatever name you want - files_to_exclude: [] - nodes_to_index: 'article' - search_only_api_key: 58ffdd7cd6c45ec1577a7fcd789b1b9a - # pagination of posts paginate: 4 per_page: 4 @@ -145,12 +137,10 @@ defaults: # Build settings plugins: - - jekyll-feed - jekyll-paginate - jekyll-gist - jekyll-seo-tag - jekyll-sitemap - - jekyll-algolia - jekyll-menus diff --git a/_includes/algolia_search.html b/_includes/algolia_search.html deleted file mode 100644 index 736785300c956..0000000000000 --- a/_includes/algolia_search.html +++ /dev/null @@ -1,70 +0,0 @@ - - - \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index b1abf4341d789..71a89023f3189 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -82,16 +82,6 @@ rel="stylesheet" href="https://cdn.snipcart.com/themes/v3.0.0-beta.3/default/snipcart.css" /> - - + + - + + @@ -143,6 +138,8 @@ integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous" > + + + + + + + diff --git a/_includes/header.html b/_includes/header.html index 6e7408816104e..97463c0ffc767 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -26,14 +26,10 @@ + + +
+ +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+ +
+ +
+
\ No newline at end of file diff --git a/_layouts/search.html b/_layouts/search.html deleted file mode 100644 index 52c3aa2573774..0000000000000 --- a/_layouts/search.html +++ /dev/null @@ -1,22 +0,0 @@ ---- -layout: default ---- - -
-
- - -
-
- - - - {%- include algolia_search.html -%} - - \ No newline at end of file diff --git a/_sass/devlopr.scss b/_sass/devlopr.scss index 6a0d46ed553b4..b21e12b314cbc 100644 --- a/_sass/devlopr.scss +++ b/_sass/devlopr.scss @@ -253,10 +253,148 @@ header { height: auto; margin: 15px; } -#search-icon { - color: var(--search-color) !important; + +/* Search Overlay */ +.icon{ + font-size: 35px; } +.search-form-container { + position: fixed; + top: 60px; + left: 0px; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); + background-color: rgba(0,0,0, 0.9); /* Black with a little bit see-through */ + z-index: 101; + white-space: nowrap; + visibility:hidden; + transition: all 0.4s ease-in-out; + transform: translate(0px, -100%) scale(0, 0); + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; + + -webkit-transform: translate(0px, -100%) scale(0, 0); + -moz-transform: translate(0px, -100%) scale(0, 0); + -o-transform: translate(0px, -100%) scale(0, 0); + -ms-transform: translate(0px, -100%) scale(0, 0); + transform: translate(0px, -100%) scale(0, 0); + + opacity: 0; + + + &__close { + position: absolute; + top: 5%; + right: 10% !important; + width: 5%; + cursor: pointer; + text-align: center; + color: orange; + + .icon { + vertical-align: text-top; + transition: 0.4s; + fill: #fff; + + &:hover { + fill: orange; + transform: rotate(90deg); + } + } + + @media (max-width: 40em) { + top: 2%; + right: 5%; + } + } + + &.is-active { + opacity: 1; + visibility: visible; + transform: translate(0px, 0px) scale(1, 1); + } + } + + .search-form { + margin-bottom:20px; + &__field { + + position: absolute; + top: 10%; + width: 100%; + color: #f69801; + background: rgba(0, 0, 0, 0); + font-size: 30px; + font-weight: 300; + text-align: center; + border: 0px; + border-bottom: 1px dashed #ffa000; + margin: 0px auto; + margin-top: -51px; + padding-left: 30px; + padding-right: 30px; + outline: none; + + &:focus { + border: 0; + border-bottom: 1px dashed #ffa000; + } + } + + &__submit { display: none; } + + &__fieldset { + border: 0; + margin-top: 10%; + padding: 0; + } + } + .search-result-container { + display:none; + } + + .search-results { + display: none; + height: 80vh; + overflow: auto; + white-space: normal; + text-align: center; + color: lightgrey; + + .heading { + margin-bottom: 16px !important; + margin-right: 16px !important; + font-size: 17px; + color: lightgrey !important; + } + + &__item { + padding-bottom: 16px; + border-bottom: 1px solid #3b4446; + margin-top: 50px; + + &__title { + display: block; + text-decoration: none; + font-size: 25px; + line-height: 25px; + color: orange !important; + text-decoration: none; + } + + &__date { + color: orange; + font-size: 15px; + line-height: 15px; + } + } + } + .breadcrumb { margin-top: 45px !important; /* margin-right: 20px !important; */ @@ -392,6 +530,7 @@ header { text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + color: coral; } .product{ diff --git a/assets/bower_components/ghosthunter/.bower.json b/assets/bower_components/ghosthunter/.bower.json new file mode 100644 index 0000000000000..dc27c6423a6c8 --- /dev/null +++ b/assets/bower_components/ghosthunter/.bower.json @@ -0,0 +1,14 @@ +{ + "name": "ghosthunter", + "homepage": "https://github.com/i11ume/ghostHunter", + "_release": "42af31a715", + "_resolution": { + "type": "branch", + "branch": "master", + "commit": "42af31a715d497ee198b42918675efcc51f513a9" + }, + "_source": "https://github.com/i11ume/ghostHunter.git", + "_target": "*", + "_originalSource": "ghosthunter", + "_direct": true +} \ No newline at end of file diff --git a/assets/bower_components/ghosthunter/.gitignore b/assets/bower_components/ghosthunter/.gitignore new file mode 100644 index 0000000000000..c2658d7d1b318 --- /dev/null +++ b/assets/bower_components/ghosthunter/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/assets/bower_components/ghosthunter/.gitmodules b/assets/bower_components/ghosthunter/.gitmodules new file mode 100644 index 0000000000000..2bd655eadebe2 --- /dev/null +++ b/assets/bower_components/ghosthunter/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/lunr"] + path = lib/lunr + url = https://github.com/olivernn/lunr.js.git diff --git a/assets/bower_components/ghosthunter/Gruntfile.js b/assets/bower_components/ghosthunter/Gruntfile.js new file mode 100644 index 0000000000000..83928f2ce829a --- /dev/null +++ b/assets/bower_components/ghosthunter/Gruntfile.js @@ -0,0 +1,39 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + copy: { + ghosthunter_embedded_lunr: { + src: "src/<%= pkg.name %>.js", + dest: "dist/jquery.ghosthunter.js", + options: { + process: function(content, path) { + var lunr = grunt.file.read('./src/lunr.js'); + content = content.replace(/\/\*\s+lunr\s+\*\//i, lunr); + var levenshtein = grunt.file.read('./src/levenshtein.js'); + content = content.replace(/\/\*\s+levenshtein\s+\*\//i, levenshtein); + return grunt.template.process(content) + } + } + }, + ghosthunter_required_lunr: { + src: "src/<%= pkg.name %>.js", + dest: "dist/jquery.ghosthunter-use-require.js", + options: { + process: function(content, path) { + content = content.replace(/\/\*\s+lunr\s+\*\//i, 'var lunr = require("lunr")'); + var levenshtein = grunt.file.read('./src/levenshtein.js'); + content = content.replace(/\/\*\s+levenshtein\s+\*\//i, levenshtein); + return grunt.template.process(content) + } + } + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-copy'); + + // Default task(s). + grunt.registerTask('default', ['copy']); +}; diff --git a/assets/bower_components/ghosthunter/LICENSE b/assets/bower_components/ghosthunter/LICENSE new file mode 100644 index 0000000000000..85767635247c2 --- /dev/null +++ b/assets/bower_components/ghosthunter/LICENSE @@ -0,0 +1,7 @@ +Copyright (C) 2014 Jamal Neufeld (jamal@i11u.me) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/assets/bower_components/ghosthunter/README.md b/assets/bower_components/ghosthunter/README.md new file mode 100644 index 0000000000000..6d9c57612e5c4 --- /dev/null +++ b/assets/bower_components/ghosthunter/README.md @@ -0,0 +1,476 @@ +![Version](https://img.shields.io/badge/Version-0.6.0-blue.svg) +![MinGhostVersion](https://img.shields.io/badge/Min%20Ghost%20v.-%3E%3D%202.10-red.svg) + +# ghostHunter + +**Original developer:** [jamal@i11u.me](mailto:jamal@i11u.me) + +GhostHunter makes it easy to add search capability to any Ghost theme, using the [Ghost API](https://api.ghost.org/v1.14.0/docs) and the [lunr.js](https://lunrjs.com) search engine. Indexing and search are done client-side (in the browser). This has several advantages: + +* Searches are private to the user, and are not exposed to third parties. +* Installation and maintenance of powerful-but-daunting standalone search engines (such as [Solr](http://lucene.apache.org/solr/) or [ElasticSearch](https://www.elastic.co/)) is not required. +* Instant search ("search-as-you-type" or "typeahead") is simple to configure. + +----------------- + +## Contents + + * [ghostHunter](#ghosthunter) + * [Contents](#contents) + * [Upgrade notes](#upgrade-notes) + * [Basic setup](#basic-setup) + * [Advanced usage](#advanced-usage) + * [Production installation](#production-installation) + * [GhostHunter options](#ghosthunter-options) + * [Multiple search fields](#multiple-search-fields) + * [Clearing search results](#clearing-search-results) + * [Indexing and caching: how it works](#indexing-and-caching-how-it-works) + * [Development: rebuilding ghostHunter](#development-rebuilding-ghosthunter) + * [Footnotes](#footnotes) + +------------------ + +## Upgrade notes +### GhostHunter v0.6.0 + +* Implements @JiapengLi "dirty fix" to support the new Ghost v2 Content API. +* Removes spurious production console.log message. +* Removes `includepages` option. + + +To use this version of ghostHunter, you'll need to create a Custom Integration and inject its Content API key into your blog header. In your Ghost Settings: + +* Go to **Integrations** +* Choose **Add custom integration**, name it `ghostHunter` and choose **Create**. Copy the generated Content API Key. +* Go to **Code injection** +* Add this to **Blog Header**: +```txt + +``` + + +### GhostHunter v0.5.1 + +Breaking change: added a new parameter `includebodysearch`, default `false`. Leaving it `false` completely deactivates searching within post body. Change done for performance reasons for Ghost Pro members. + +### GhostHunter v0.4.x → v0.5.0 + +The local ``lunr.js`` index used by ghostHunter is quick. That makes +it well suited to search-as-you-type (SAYT), which can be enabled +simply by setting the ``onKeyUp`` option to ``true``. Although fast +and convenient, the rapid clearing-and-rewriting of search results in +SAYT mode can be distracting to the user. + +From version 0.5.0, ghostHunter uses a [Levenshtein edit +distance](https://en.wikipedia.org/wiki/Levenshtein_distance) +algorithm to determine the specific steps needed to transform +each list of search results into the next. This produces screen +updates that are easy on the eye, and even pleasant to watch. + +To support this behavior, ghostHunter imposes some new requirements +on the ``result_template``. If you use this option in your theme, +you edit the template to satisfy the following requirements +before upgrading: + + * The template *must* be wrapped in a single outer node (i.e. ```` or ``div``); + * The outer node *must* have a unique ``id`` attribute. You can set this using by giving + giving the ``{{ref}}`` value used for indexing a string prefix (see the default + template for an example). + * The outer node *must* be assigned a class ``gh-search-item``. + +That's it. With those changes, your theme should be ready for ghostHunter 0.5.0. + +## Basic setup + +In your theme directory, navigate to the `assets` subdirectory,
[1] and clone this repository there: [2] + +```txt + cd assets + git clone https://github.com/jamalneufeld/ghostHunter.git --recursive +``` + +After cloning, the ghostHunter module will be located at `assets/ghostHunter/dist/jquery.ghosthunter.js`. [3] This is a human-readable "raw" copy of the module, and can be loaded directly in your theme templates for testing. (It will run just fine, but it contains a lot of whitespace and comments, and should be "minified" for production use [see below]). + +To test the module in your template, add the following line, after JQuery is loaded. Typically this will be near the bottom of a file `default.hbs`, in the top folder of the theme directory. + +````html + +```` + +You will need to add a search box to your pages. The specific `.hbs` template and location will vary depending on the style and on your design choices, but the HTML will need an `` field and a submit button inside a `
` element. A block like this should do the trick: + +````html + + + +
+```` + +You will also need to mark an area in your pages where the search results should show up: + +````html +
+```` + +Wake up ghostHunter with a block of JQuery code. For testing, the sample below can be placed in the +template that loads ghostHunter, immediately after the module is loaded: + +````html + +```` + +Do the necessaries to [load the theme into Ghost](https://themes.ghost.org/v1.17.0/docs/about), and see if it works. :sweat_smile: + + +## Advanced usage + +### Production installation + +To reduce load times and network traffic, the JavaScript of a site is typically "minified," bundling all code into a single file with reduced whitespace and other optimizations. The ``jquery.ghosthunter.js`` module should be bundled in this way for the production version of your site. The most common tool for this purpose in Web development is either Grunt or Gulp. A full explanation of their use is beyond the scope of this guide, but here are some links for reference: + +* The [Gulp Project](https://gulpjs.com/) website. +* The [Grunt Project](https://gruntjs.com/) website. + +GhostHunter is built using Grunt. Instructions on installing Grunt in order to tweak or extend the code of the ghostHunter module are given in a separate section below. + + +### GhostHunter options + +The behavior of ghostHunter can be controlled at two levels. For deep +changes, [4] see the section [Development: +rebuilding ghostHunter](#development-rebuilding-ghosthunter) below. + +For most purposes, ghostHunter offers a set of simple options can be +set when the plugin is invoked: as an example, the last code sample in +the previous section sets the `results` option. + +:arrow_right: **results** + +> Should be set to the JQuery ID of the DOM object into which search results should be inserted. This value is required. +> +> Default value is ``undefined``. + +:arrow_right: **onKeyUp** + +> When set ``true``, search results are returned after each keystroke, for instant search-as-you-type results. +> +> Default value is ``false`` + +:arrow_right: **result_template** + +> A simple Handlebars template used to render individual items in the search result. The templates +> recognize variable substitution only; helpers and conditional insertion constructs are ignored, +> and will be rendered verbatim. +> +> From ghostHunter v0.5.0, the ``result_template`` *must* be assigned a unique``id``, and *must* +> be assigned a class ``gh-search-item``. Without these attributes, screen updates will not +> work correctly. +> +> Default template is <a id='gh-{{ref}}' class='gh-search-item' href='{{link}}'><p><h2>{{title}}</h2><h4>{{prettyPubDate}}</h4></p></a> + +:arrow_right: **info_template** + +> A Handlebars template used to display the number of search items returned. +> +> Default template is <p>Number of posts found: {{amount}}</p> + +:arrow_right: **displaySearchInfo** + +> When set ``true``, the number of search items returned is shown immediately above the list of search hits. The notice is formatted using ``info_template``. +> +> Default value is ``true``. + +:arrow_right: **zeroResultsInfo** + +> When set ``true``, the number-of-search-items notice formatted using ``info_template`` is shown even when the number of items is zero. When set to false, the notice is suppressed when there are no search results. +> +> Default value is ``true``. + +:arrow_right: **subpath** + +> If Ghost is hosted in a subfolder of the site, set this string to the path leading to Ghost (for example, ``"/blog"``). The value is prepended to item slugs in search returns. +> +> Default value is an empty string. + +:arrow_right: **onPageLoad** + +> When set ``true``, posts are checked and indexed when a page is +> loaded. Early versions of ghostHunter default behavior was to +> initiate indexing when focus fell in the search field, to reduce the +> time required for initial page loads. With caching and other +> changes, this is no longer needed, and this option can safely be set +> to ``true`` always. +> +> Default value is ``true``. + +:arrow_right: **before** + +> Use to optionally set a callback function that is executed immediately before the list of search results is displayed. The callback function takes no arguments. +> +> Example: + +````javascript +$("#search-field").ghostHunter({ + results: "#results", + before: function() { + alert("results are about to be rendered"); + } +}); + +```` +> Default value is ``false``. + +:arrow_right: **onComplete** + +> Use to optionally set a callback function that is executed immediately after the list of search results is displayed. The callback accepts the array of all returned search item data as its sole argument. +> A function like that shown in the following example could be used with search-as-you-type to hide and reveal a search area and the current page content, depending on whether the search box contains any text. + +````javascript +$("#search-field").ghostHunter({ + results: "#results", + onComplete: function(results) { + if ($('.search-field').prop('value')) { + $('.my-search-area').show(); + $('.my-display-area').hide(); + } else { + $('.my-search-area').hide(); + $('.my-display-area').show(); + } + } +}); +```` +> Default value is ``false``. + +:arrow_right: **item_preprocessor** + +> Use to optionally set a callback function that is executed immediately before items are indexed. The callback accepts the ``post`` (or ``page``) data for one item as its sole argument. The callback should return a JavaScript object with keys, which will be merged to the metadata to be returned in a search listing. +> +> Example: + +````javascript +item_preprocessor: function(item) { + var ret = {}; + var thisDate = new Date(item.updated_at); + var aWeekAgo = new Date(thisDate.getTime() - 1000*60*60*24*7); + if (thisDate > aWeekAgo) { + ret.recent = true; + } else { + ret.recent = false; + } + return ret; +} +```` +> With the sample function above, ``result_template`` could be set to something like this: + +````javascript +result_template: '

{{#if recent}}NEW! {{/if}}{{title}}

' +```` +> Default value is ``false``. + +:arrow_right: **indexing_start** + +> Use to optionally set a callback that is executed immediately before an indexing operation begins. +> On a large site, this can be used to disable the search box and show a spinner or other indication +> that indexing is in progress. (On small sites, the time required for indexing will be so small that +> such flourishes would not be notice.) + +````javascript +indexing_start: function() { + $('.search-field') + .prop('disabled', true) + .addClass('yellow-bg') + .prop('placeholder', 'Indexing, please wait'); +} +```` +> Default value is ``false``. + + +:arrow_right: **indexing_end** + +> Use to optionally set a callback that is executed after an indexing operation completes. +> This is a companion to ``indexing_start`` above. + +````javascript +indexing_end: function() { + $('.search-field') + .prop('placeholder', 'Search …') + .removeClass('yellow-bg') + .prop('disabled', false); +} +```` + +> Default value is ``false``. + +:arrow_right: **includebodysearch** + +> Use to allow searching within the full post body. + +> Default value is ``false``. + +### Multiple search fields + +There should be only one ``ghostHunter`` object in a page; if there +are two, both will attempt to instantiate at the same time, and bad +things will happen. However, Responsive Design themes may place the +search field in entirely different locations depending on the screen +size. You can use a single ``ghostHunter`` object to serve multiple +search fields with a coding pattern like the following: [5] + +1. Include a single hidden search field in your templates. This will + be the ``ghostHunter`` object. + +```html + +``` + +2. Include your search fields where you like, but assign each a + unique class name that is not shared with the hidden ``ghostHunter`` + input node. + +```html + +``` + +3. In the JavaScript of your theme, instantiate ghostHunter on the + hidden node: + +```html +$('.search-field').ghostHunter({ + results: '#results', + onKeyUp: true +}): +``` + +4. Register an event on the others that spoofs the steps needed + to submit the query to ``ghostHunter``: + +```html +$('.search-field-mobile, .search-field-desktop').on('keyup', function(event) { + $('.search-field').prop('value', event.target.value); + $('.search-field').trigger('keyup'); +}); +``` + +### Clearing search results + +You can use the ghostHunter object to programmatically clear the results of your query. ghostHunter will return an object relating to your search field and you can use that object to clear results. + +````js +var searchField = $("#search-field").ghostHunter({ + results: "#results", + onKeyUp: true +}); +```` + +Now that the object is available to your code you can call it any time to clear your results: + +````js +searchField.clear(); +```` + +### Indexing and caching: how it works + +After the load of any page in which ghostHunter is included, GH builds +a full-text index of all posts. Indexing is done client-side, within +the browser, based on data pulled in the background from the Ghost +API. To reduce network traffic and processing burden, index data is +cached to the extent possible in the browser's ``localStorage`` object, +according to the following rules: + +1. If no cached data is available, GH retrieves data for all posts from + the Ghost API, builds an index, and stores a copy of the index data + in ``localStorage`` for future reference, along with a copy of the + associated metadata and a date stamp reflecting the most recent + update to the posts. + +2. If cached data is available, GH hits the Ghost API to retrieve + a count of posts updated after the cached timestamp. + + * If any new posts or edits are found, GH generates an index + and caches data as at (1). + + * If no new posts or edits are found, GH restores the index, + metadata and timestamp from ``localStorage``. + +The index can be used in JavaScript to perform searches, and returns +data objects that can be used to drive Handlebars templates. + +### Development: rebuilding ghostHunter + +The ``jquery.ghosthunter.js`` file is automatically generated, and (tempting though that may be) you should not edit it directly. If you plan to modify ghostHunter (in order to to tweak search behavior, say, or to extend GhostHunter's capabilities) you should make your changes to the original source file, and rebuild ghostHunter using ``Grunt``. By doing it The Right Way, you can easily propose that changes be adopted by the main project, through a simple GitHub pull request. + +To set things up for development work, start by entering the ``ghostHunter`` directory: +```bash +prompt> cd ghostHunter +``` +Install the Grunt command line tool globally (the command below is appropriate for Linux systems, your mileage may vary): +```bash +prompt> sudo npm install -g grunt-cl +``` +Install Grunt and the other node.js modules needed for the build: +```bash +prompt> npm install + ``` +Try rebuilding ghostHunter: +```bash +prompt> grunt +``` +Once you are able to rebuild ghostHunter, you can edit the source file at ``src/ghosthunter.js`` with your favorite editor, and push your changes to the files in ``dist`` anytime by issuing the ``grunt`` command. + +## Version 0.5.0 notes + +* Graceful Levenshtein updating of search list +* Search queries as fuzzy match to each term, joined by AND + +## Version 0.4.1 notes + +* Incude lunr as a submodule, update to lunr.js v2.1 +* Set up Grunt to produce use-require and embedded versions of plugin from a single source file +* Cache index, metadata, and timestamp in localStorage +* Include tags list in search-list metadata +* Add options: + - ``subpath`` string for subfolder deployments + - ``item_preprocessor`` callback + - ``indexing_start`` callback + - ``indexing_end`` callback +* Edits to README + +## Version 0.4.0 notes + +* Compatible with Ghost 1.0 +* Uses the Ghost API. If you need the RSS version you can use [this](https://github.com/jamalneufeld/ghostHunter/commit/2e721620868d127e9e688145fabcf5f86249d11b) commit, or @lizhuoli1126's [fork](https://github.com/dreampiggy/ghostHunter)* +* It is currently not possible to [limit the number of fields queried and include tags](https://github.com/TryGhost/Ghost/issues/5615) in a single Ghost API call. + +---------- + +# Footnotes + +[1] The ghostHunter module, and any other JavaScript, CSS or icon code should always be placed under the `assets` directory. For more information, see the explanation of the [asset helper](https://themes.ghost.org/v1.17.0/docs/asset). + +[2] In this case, the cloned `git` repository can be updated by entering the `ghostHunter` directory and doing `git pull`. There are a couple of alternatives: + + * You can just download the ZIP archive and unpack it in `assets`. To update to a later version, download and unZIP again. + * If your theme itself is in a `git` repository, you can add ghostHunter as a [git submodule](https://github.com/blog/2104-working-with-submodules) or a [git subtree](https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree). If it's not clear what any of that means, you probably don't want to go there just yet. + +[3] There is another copy of the module in `dist` called `jquery.ghosthunter.use-require.js`. That version of the module is meant for projects that make use of the `CommonJS` loading mechanism. If you are not using `CommonJS`, you can ignore this version of the module. + +[4] Features requiring deeper control would include fuzzy searches by [Levenstein distance](https://en.wikipedia.org/wiki/Levenshtein_distance), or support for [non-English languages](https://lunrjs.com/guides/language_support.html) in `lunr.js`, for example. + +[5] The example given in the text assumes +search-as-you-type mode. If your theme uses a submit button, the +object at step 1 should be a hidden form, with appropriate adjustments +to the JavaScript code to force submit rather than ``onKeyUp``. diff --git a/assets/bower_components/ghosthunter/changelog.txt b/assets/bower_components/ghosthunter/changelog.txt new file mode 100644 index 0000000000000..b9a3490ef9d4b --- /dev/null +++ b/assets/bower_components/ghosthunter/changelog.txt @@ -0,0 +1,15 @@ +v0.5.1 : Performance enhancements to stop involuntary DDOS +v0.5.0 : Levenshtein screen updates, fuzzy searching thanks to @fbennett +v0.4.1 : Index caching, repo reorganization, extended metadata thanks to @fbennett +v0.4.0 : Ghost 1.0 compatibility +v0.3.5 : Exported query options ; added option to search static pages +v0.3.4 : Added onPageLoad option to improve onKeyUp option thanks to @cjsheets. +v0.3.3 : Exported Lunr to a separate js file ; made the no-dependency version available. +v0.3.2 : Added PrettyDate option thanks to @alavers +v0.3.1 : Added tag support in the index thanks to @lizhuoli1126 +v0.3.0 : Stopped using RSS, started using API. +v0.2.3 : Added callbacks + Added tags/categories to the indexed data +v0.2.2 : Added the "clear" method +v0.2 : Added ability to have search occur onKeyUp +v0.1 : Initial commit, fully functional alpha diff --git a/assets/bower_components/ghosthunter/dist/jquery.ghostHunter.min.js b/assets/bower_components/ghosthunter/dist/jquery.ghostHunter.min.js new file mode 100644 index 0000000000000..68f1c305cdd5b --- /dev/null +++ b/assets/bower_components/ghosthunter/dist/jquery.ghostHunter.min.js @@ -0,0 +1 @@ +(function($){var lunr=function(t){var e=new lunr.Index;return e.pipeline.add(lunr.stopWordFilter,lunr.stemmer),t&&t.call(e,e),e};lunr.version="0.4.3","undefined"!=typeof module&&(module.exports=lunr),lunr.utils={},lunr.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),lunr.utils.zeroFillArray=function(){var t=[0];return function(e){for(;e>t.length;)t=t.concat(t);return t.slice(0,e)}}(),lunr.EventEmitter=function(){this.events={}},lunr.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},lunr.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},lunr.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},lunr.EventEmitter.prototype.hasHandler=function(t){return t in this.events},lunr.tokenizer=function(t){if(!arguments.length||null==t||void 0==t)return[];if(Array.isArray(t))return t.map(function(t){return t.toLowerCase()});for(var e=(""+t).replace(/^\s+/,""),n=e.length-1;n>=0;n--)if(/\S/.test(e.charAt(n))){e=e.substring(0,n+1);break}return e.split(/\s+/).map(function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"").toLowerCase()})},lunr.Pipeline=function(){this._stack=[]},lunr.Pipeline.registeredFunctions={},lunr.Pipeline.registerFunction=function(t,e){e in this.registeredFunctions&&lunr.utils.warn("Overwriting existing registered function: "+e),t.label=e,lunr.Pipeline.registeredFunctions[t.label]=t},lunr.Pipeline.warnIfFunctionNotRegistered=function(t){var e=t.label&&t.label in this.registeredFunctions;e||lunr.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},lunr.Pipeline.load=function(t){var e=new lunr.Pipeline;return t.forEach(function(t){var n=lunr.Pipeline.registeredFunctions[t];if(!n)throw Error("Cannot load un-registered function: "+t);e.add(n)}),e},lunr.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){lunr.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},lunr.Pipeline.prototype.after=function(t,e){lunr.Pipeline.warnIfFunctionNotRegistered(e);var n=this._stack.indexOf(t)+1;this._stack.splice(n,0,e)},lunr.Pipeline.prototype.before=function(t,e){lunr.Pipeline.warnIfFunctionNotRegistered(e);var n=this._stack.indexOf(t);this._stack.splice(n,0,e)},lunr.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);this._stack.splice(e,1)},lunr.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,r=this._stack.length,o=0;n>o;o++){for(var i=t[o],s=0;r>s&&(i=this._stack[s](i,o,t),void 0!==i);s++);void 0!==i&&e.push(i)}return e},lunr.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return lunr.Pipeline.warnIfFunctionNotRegistered(t),t.label})},lunr.Vector=function(t){this.elements=t},lunr.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t,e=0,n=this.elements,r=n.length,o=0;r>o;o++)t=n[o],e+=t*t;return this._magnitude=Math.sqrt(e)},lunr.Vector.prototype.dot=function(t){for(var e=this.elements,n=t.elements,r=e.length,o=0,i=0;r>i;i++)o+=e[i]*n[i];return o},lunr.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},lunr.Vector.prototype.toArray=function(){return this.elements},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},lunr.SortedSet.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(t){~this.indexOf(t)||this.elements.splice(this.locationFor(t),0,t)},this),this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(t,e){return this.elements.map(t,e)},lunr.SortedSet.prototype.forEach=function(t,e){return this.elements.forEach(t,e)},lunr.SortedSet.prototype.indexOf=function(t,e,n){var e=e||0,n=n||this.elements.length,r=n-e,o=e+Math.floor(r/2),i=this.elements[o];return 1>=r?i===t?o:-1:t>i?this.indexOf(t,o,n):i>t?this.indexOf(t,e,o):i===t?o:void 0},lunr.SortedSet.prototype.locationFor=function(t,e,n){var e=e||0,n=n||this.elements.length,r=n-e,o=e+Math.floor(r/2),i=this.elements[o];if(1>=r){if(i>t)return o;if(t>i)return o+1}return t>i?this.locationFor(t,o,n):i>t?this.locationFor(t,e,o):void 0},lunr.SortedSet.prototype.intersect=function(t){for(var e=new lunr.SortedSet,n=0,r=0,o=this.length,i=t.length,s=this.elements,l=t.elements;;){if(n>o-1||r>i-1)break;s[n]!==l[r]?s[n]l[r]&&r++:(e.add(s[n]),n++,r++)}return e},lunr.SortedSet.prototype.clone=function(){var t=new lunr.SortedSet;return t.elements=this.toArray(),t.length=t.elements.length,t},lunr.SortedSet.prototype.union=function(t){var e,n,r;return this.length>=t.length?(e=this,n=t):(e=t,n=this),r=e.clone(),r.add.apply(r,n.toArray()),r},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},lunr.Index=function(){this._fields=[],this._ref="id",this.pipeline=new lunr.Pipeline,this.documentStore=new lunr.Store,this.tokenStore=new lunr.TokenStore,this.corpusTokens=new lunr.SortedSet,this.eventEmitter=new lunr.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},lunr.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},lunr.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},lunr.Index.load=function(t){t.version!==lunr.version&&lunr.utils.warn("version mismatch: current "+lunr.version+" importing "+t.version);var e=new this;return e._fields=t.fields,e._ref=t.ref,e.documentStore=lunr.Store.load(t.documentStore),e.tokenStore=lunr.TokenStore.load(t.tokenStore),e.corpusTokens=lunr.SortedSet.load(t.corpusTokens),e.pipeline=lunr.Pipeline.load(t.pipeline),e},lunr.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},lunr.Index.prototype.ref=function(t){return this._ref=t,this},lunr.Index.prototype.add=function(t,e){var n={},r=new lunr.SortedSet,o=t[this._ref],e=void 0===e?!0:e;this._fields.forEach(function(e){var o=this.pipeline.run(lunr.tokenizer(t[e.name]));n[e.name]=o,lunr.SortedSet.prototype.add.apply(r,o)},this),this.documentStore.set(o,r),lunr.SortedSet.prototype.add.apply(this.corpusTokens,r.toArray());for(var i=0;r.length>i;i++){var s=r.elements[i],l=this._fields.reduce(function(t,e){var r=n[e.name].length;if(!r)return t;var o=n[e.name].filter(function(t){return t===s}).length;return t+o/r*e.boost},0);this.tokenStore.add(s,{ref:o,tf:l})}e&&this.eventEmitter.emit("add",t,this)},lunr.Index.prototype.remove=function(t,e){var n=t[this._ref],e=void 0===e?!0:e;if(this.documentStore.has(n)){var r=this.documentStore.get(n);this.documentStore.remove(n),r.forEach(function(t){this.tokenStore.remove(t,n)},this),e&&this.eventEmitter.emit("remove",t,this)}},lunr.Index.prototype.update=function(t,e){var e=void 0===e?!0:e;this.remove(t,!1),this.add(t,!1),e&&this.eventEmitter.emit("update",t,this)},lunr.Index.prototype.idf=function(t){if(this._idfCache[t])return this._idfCache[t];var e=this.tokenStore.count(t),n=1;return e>0&&(n=1+Math.log(this.tokenStore.length/e)),this._idfCache[t]=n},lunr.Index.prototype.search=function(t){var e=this.pipeline.run(lunr.tokenizer(t)),n=lunr.utils.zeroFillArray(this.corpusTokens.length),r=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),i=e.some(function(t){return this.tokenStore.has(t)},this);if(!i)return[];e.forEach(function(t,e,i){var s=1/i.length*this._fields.length*o,l=this,u=this.tokenStore.expand(t).reduce(function(e,r){var o=l.corpusTokens.indexOf(r),i=l.idf(r),u=1,a=new lunr.SortedSet;if(r!==t){var h=Math.max(3,r.length-t.length);u=1/Math.log(h)}return o>-1&&(n[o]=s*i*u),Object.keys(l.tokenStore.get(r)).forEach(function(t){a.add(t)}),e.union(a)},new lunr.SortedSet);r.push(u)},this);var s=r.reduce(function(t,e){return t.intersect(e)}),l=new lunr.Vector(n);return s.map(function(t){return{ref:t,score:l.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},lunr.Index.prototype.documentVector=function(t){for(var e=this.documentStore.get(t),n=e.length,r=lunr.utils.zeroFillArray(this.corpusTokens.length),o=0;n>o;o++){var i=e.elements[o],s=this.tokenStore.get(i)[t].tf,l=this.idf(i);r[this.corpusTokens.indexOf(i)]=s*l}return new lunr.Vector(r)},lunr.Index.prototype.toJSON=function(){return{version:lunr.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},lunr.Store=function(){this.store={},this.length=0},lunr.Store.load=function(t){var e=new this;return e.length=t.length,e.store=Object.keys(t.store).reduce(function(e,n){return e[n]=lunr.SortedSet.load(t.store[n]),e},{}),e},lunr.Store.prototype.set=function(t,e){this.store[t]=e,this.length=Object.keys(this.store).length},lunr.Store.prototype.get=function(t){return this.store[t]},lunr.Store.prototype.has=function(t){return t in this.store},lunr.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},lunr.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},lunr.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",r="[aeiouy]",o=n+"[^aeiouy]*",i=r+"[aeiou]*",s="^("+o+")?"+i+o,l="^("+o+")?"+i+o+"("+i+")?$",u="^("+o+")?"+i+o+i+o,a="^("+o+")?"+r;return function(n){var i,h,c,p,f,d,v;if(3>n.length)return n;if(c=n.substr(0,1),"y"==c&&(n=c.toUpperCase()+n.substr(1)),p=/^(.+?)(ss|i)es$/,f=/^(.+?)([^s])s$/,p.test(n)?n=n.replace(p,"$1$2"):f.test(n)&&(n=n.replace(f,"$1$2")),p=/^(.+?)eed$/,f=/^(.+?)(ed|ing)$/,p.test(n)){var m=p.exec(n);p=RegExp(s),p.test(m[1])&&(p=/.$/,n=n.replace(p,""))}else if(f.test(n)){var m=f.exec(n);i=m[1],f=RegExp(a),f.test(i)&&(n=i,f=/(at|bl|iz)$/,d=RegExp("([^aeiouylsz])\\1$"),v=RegExp("^"+o+r+"[^aeiouwxy]$"),f.test(n)?n+="e":d.test(n)?(p=/.$/,n=n.replace(p,"")):v.test(n)&&(n+="e"))}if(p=/^(.+?)y$/,p.test(n)){var m=p.exec(n);i=m[1],p=RegExp(a),p.test(i)&&(n=i+"i")}if(p=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,p.test(n)){var m=p.exec(n);i=m[1],h=m[2],p=RegExp(s),p.test(i)&&(n=i+t[h])}if(p=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,p.test(n)){var m=p.exec(n);i=m[1],h=m[2],p=RegExp(s),p.test(i)&&(n=i+e[h])}if(p=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,f=/^(.+?)(s|t)(ion)$/,p.test(n)){var m=p.exec(n);i=m[1],p=RegExp(u),p.test(i)&&(n=i)}else if(f.test(n)){var m=f.exec(n);i=m[1]+m[2],f=RegExp(u),f.test(i)&&(n=i)}if(p=/^(.+?)e$/,p.test(n)){var m=p.exec(n);i=m[1],p=RegExp(u),f=RegExp(l),d=RegExp("^"+o+r+"[^aeiouwxy]$"),(p.test(i)||f.test(i)&&!d.test(i))&&(n=i)}return p=/ll$/,f=RegExp(u),p.test(n)&&f.test(n)&&(p=/.$/,n=n.replace(p,"")),"y"==c&&(n=c.toLowerCase()+n.substr(1)),n}}(),lunr.Pipeline.registerFunction(lunr.stemmer,"stemmer"),lunr.stopWordFilter=function(t){return-1===lunr.stopWordFilter.stopWords.indexOf(t)?t:void 0},lunr.stopWordFilter.stopWords=new lunr.SortedSet,lunr.stopWordFilter.stopWords.length=119,lunr.stopWordFilter.stopWords.elements=["","a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"],lunr.Pipeline.registerFunction(lunr.stopWordFilter,"stopWordFilter"),lunr.TokenStore=function(){this.root={docs:{}},this.length=0},lunr.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},lunr.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,r=t[0],o=t.slice(1);return r in n||(n[r]={docs:{}}),0===o.length?(n[r].docs[e.ref]=e,this.length+=1,void 0):this.add(o,e,n[r])},lunr.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;t.length>n;n++){if(!e[t[n]])return!1;e=e[t[n]]}return!0},lunr.TokenStore.prototype.getNode=function(t){if(!t)return{};for(var e=this.root,n=0;t.length>n;n++){if(!e[t[n]])return{};e=e[t[n]]}return e},lunr.TokenStore.prototype.get=function(t,e){return this.getNode(t,e).docs||{}},lunr.TokenStore.prototype.count=function(t,e){return Object.keys(this.get(t,e)).length},lunr.TokenStore.prototype.remove=function(t,e){if(t){for(var n=this.root,r=0;t.length>r;r++){if(!(t[r]in n))return;n=n[t[r]]}delete n.docs[e]}},lunr.TokenStore.prototype.expand=function(t,e){var n=this.getNode(t),r=n.docs||{},e=e||[];return Object.keys(r).length&&e.push(t),Object.keys(n).forEach(function(n){"docs"!==n&&e.concat(this.expand(t+n,e))},this),e},lunr.TokenStore.prototype.toJSON=function(){return{root:this.root,length:this.length}};$.fn.ghostHunter=function(options){var opts=$.extend({},$.fn.ghostHunter.defaults,options);if(opts.results){pluginMethods.init(this,opts);return pluginMethods}};$.fn.ghostHunter.defaults={results:false,rss:"/rss",onKeyUp:false,result_template:"

{{title}}

{{pubDate}}

",info_template:"

Number of posts found: {{amount}}

",displaySearchInfo:true,zeroResultsInfo:true,before:false,onComplete:false};var pluginMethods={isInit:false,init:function(target,opts){var that=this;this.target=target;this.rss=opts.rss;this.results=opts.results;this.blogData=[];this.result_template=opts.result_template;this.info_template=opts.info_template;this.zeroResultsInfo=opts.zeroResultsInfo;this.displaySearchInfo=opts.displaySearchInfo;this.before=opts.before;this.onComplete=opts.onComplete;this.index=lunr(function(){this.field("title",{boost:10});this.field("description");this.field("link");this.field("category");this.field("pubDate");this.ref("id")});target.focus(function(){that.loadRSS()});target.closest("form").submit(function(e){e.preventDefault();that.find(target.val())});if(opts.onKeyUp){that.loadRSS();target.keyup(function(){that.find(target.val())})}},loadRSS:function(){if(this.isInit)return false;var index=this.index,rssURL=this.rss,blogData=this.blogData;$.get(rssURL,function(data){var posts=$(data).find("item");for(var i=0;posts&&i0){if(this.displaySearchInfo)results.append(this.format(this.info_template,{amount:searchResult.length}))}for(var i=0;i 0 ? matrix[x][y-1] : Number.MAX_VALUE + l = x > 0 ? matrix[x-1][y] : Number.MAX_VALUE + d = y > 0 && x > 0 ? matrix[x-1][y-1] : Number.MAX_VALUE + min = Math.min(u, l, d) + if(min === d) { + if(d < matrix[x][y]) { + steps.push(['substitute', y, x]) + }// else steps.push(['no-op', y, x]) + x-- + y-- + } else if(min === l) { + steps.push(['insert', y, x]) + x-- + } else { + steps.push(['delete', y, x]) + y-- + } + } + return steps + } + + Levenshtein.prototype.getMatrix = function () { + return this._matrix.slice() + } + + Levenshtein.prototype.valueOf = function() { + return this.distance + } + + return Levenshtein + +})); + + + //This is the main plugin definition + $.fn.ghostHunter = function( options ) { + + //Here we use jQuery's extend to set default values if they weren't set by the user + var opts = $.extend( {}, $.fn.ghostHunter.defaults, options ); + if( opts.results ) + { + pluginMethods.init( this , opts ); + return pluginMethods; + } + }; + // If the Ghost instance is in a subpath of the site, set subpath + // as the path to the site with a leading slash and no trailing slash + // (i.e. "/path/to/instance"). + $.fn.ghostHunter.defaults = { + resultsData : false, + onPageLoad : false, + onKeyUp : false, + result_template : "

{{title}}

{{prettyPubDate}}

", + info_template : "

Number of posts found: {{amount}}

", + displaySearchInfo : true, + zeroResultsInfo : true, + before : false, + onComplete : false, + filterfields : false, + subpath : "", + item_preprocessor : false, + indexing_start : false, + indexing_end : false, + includebodysearch : false + }; + var prettyDate = function(date) { + var d = new Date(date); + var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + return d.getDate() + ' ' + monthNames[d.getMonth()] + ' ' + d.getFullYear(); + }; + + var getSubpathKey = function(str) { + return str.replace(/^\//, "").replace(/\//g, "-") + }; + + var lastTimeoutID = null; + + // We add a prefix to new IDs and remove it after a set of + // updates is complete, just in case a browser freaks over + // duplicate IDs in the DOM. + var settleIDs = function() { + $('.gh-search-item').each(function(){ + var oldAttr = this.getAttribute('id'); + var newAttr = oldAttr.replace(/^new-/, ""); + this.setAttribute('id', newAttr); + }); + }; + var updateSearchList = function(listItems, apiData, steps) { + for (var i=0,ilen=steps.length;i recordedDate) { + me.latestPost = arrayItem.updated_at; + } + var tag_arr = arrayItem.tags.map(function(v) { + return v.name; // `tag` object has an `name` property which is the value of tag. If you also want other info, check API and get that property + }) + if(arrayItem.meta_description == null) { arrayItem.meta_description = '' }; + var category = tag_arr.join(", "); + if (category.length < 1){ + category = "undefined"; + } + var parsedData = { + id : String(arrayItem.id), + title : String(arrayItem.title), + description : String(arrayItem.custom_excerpt), + pubDate : String(arrayItem.published_at), + tag : category + } + if ( me.includebodysearch ){ + parsedData.plaintext=String(arrayItem.plaintext); + } + this.add(parsedData) + var localUrl = me.subpath + arrayItem.url + me.blogData[arrayItem.id] = { + title: arrayItem.title, + description: arrayItem.custom_excerpt, + pubDate: prettyDate(parsedData.pubDate), + link: localUrl, + tags: tag_arr + }; + // If there is a metadata "pre"-processor for the item, run it here. + if (me.item_preprocessor) { + Object.assign(me.blogData[arrayItem.id], me.item_preprocessor(arrayItem)); + } + // console.log("done indexing the item"); + }, this); + }); + try { + var subpathKey = getSubpathKey(me.subpath); + localStorage.setItem(("ghost_" + subpathKey + "_lunrIndex"), JSON.stringify(me.index)); + localStorage.setItem(("ghost_" + subpathKey + "_blogData"), JSON.stringify(me.blogData)); + localStorage.setItem(("ghost_" + subpathKey + "_latestPost"), me.latestPost); + } catch (e) { + console.warn("ghostHunter: save to localStorage failed: " + e); + } + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + }); + } + + var pluginMethods = { + + isInit : false, + + init : function( target , opts ){ + var that = this; + that.target = target; + Object.assign(this, opts); + // console.log("ghostHunter: init"); + if ( opts.onPageLoad ) { + function miam () { + that.loadAPI(); + } + window.setTimeout(miam, 1); + } else { + target.focus(function(){ + that.loadAPI(); + }); + } + + target.closest("form").submit(function(e){ + e.preventDefault(); + that.find(target.val()); + }); + + if( opts.onKeyUp ) { + // In search-as-you-type mode, the Enter key is meaningless, + // so we disable it in the search field. If enabled, some browsers + // will save data to history (even when autocomplete="false"), which + // is an intrusive headache, particularly on mobile. + target.keydown(function(event){ + if (event.which === 13) { + return false; + } + }); + target.keyup(function(event) { + that.find(target.val()); + }); + + } + + }, + + loadAPI : function(){ + // console.log('ghostHunter: loadAPI'); + if(!this.isInit) { + // console.log('ghostHunter: this.isInit is true'); + if (this.indexing_start) { + this.indexing_start(); + } + // If isInit is falsy, check for data in localStore, + // parse into memory, and declare isInit to be true. + try { + var subpathKey = getSubpathKey(this.subpath); + this.index = localStorage.getItem(("ghost_" + subpathKey + "_lunrIndex")); + this.blogData = localStorage.getItem(("ghost_" + subpathKey + "_blogData")); + this.latestPost = localStorage.getItem(("ghost_" + subpathKey + "_latestPost")); + if (this.latestPost && this.index && this.blogData) { + this.latestPost = this.latestPost; + this.index = lunr.Index.load(JSON.parse(this.index)); + this.blogData = JSON.parse(this.blogData); + this.isInit = true; + } + } catch (e){ + console.warn("ghostHunter: retrieve from localStorage failed: " + e); + } + } + if (this.isInit) { + // console.log('ghostHunter: this.isInit recheck is true'); + // Check if there are new or edited posts + var params = { + limit: "all", + filter: "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'", + fields: "id" + }; + + var url = "/ghost/api/v2/content/posts/?key=" + ghosthunter_key + "&limit=all&fields=id" + "&filter=" + "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'"; + + var me = this; + $.get(url).done(function(data){ + if (data.posts.length > 0) { + grabAndIndex.call(me); + } else { + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + } + }); + } else { + // console.log('ghostHunter: this.isInit recheck is false'); + grabAndIndex.call(this) + } + }, + + + find : function(value){ + clearTimeout(lastTimeoutID); + if (!value) { + value = ""; + }; + value = value.toLowerCase(); + lastTimeoutID = setTimeout(function() { + // Query strategy is lifted from comments on a lunr.js issue: https://github.com/olivernn/lunr.js/issues/256 + var thingsFound = []; + // The query interface expects single terms, so we split. + var valueSplit = value.split(/\s+/); + for (var i=0,ilen=valueSplit.length;i 1) { + // If we had multiple terms, we'll have multiple lists. We filter + // them here to use only items that produce returns for all + // terms. This spoofs an AND join between terms, which lunr.js can't + // yet do internally. + // By using the first list of items as master, we get weightings + // based on the first term entered, which is more or less + // what we would expect. + var searchResult = thingsFound[0]; + thingsFound = thingsFound.slice(1); + for (var i=searchResult.length-1;i>-1;i--) { + var ref = searchResult[i].ref; + for (j=0,jlen=thingsFound.length;j 0) { + results.children().eq(0).replaceWith(this.format(this.info_template,{"amount":searchResult.length})); + } else { + results.append(this.format(this.info_template,{"amount":searchResult.length})); + } + } + + if(this.before) { + this.before(); + }; + + // Get the blogData for the full set, for onComplete + for (var i = 0; i < searchResult.length; i++) { + var lunrref = searchResult[i].ref; + var postData = this.blogData[lunrref]; + if (postData) { + postData.ref = lunrref; + resultsData.push(postData); + } else { + console.warn("ghostHunter: index/data mismatch. Ouch."); + } + } + // Get an array of IDs present in current results + var listItems = $('.gh-search-item'); + var currentRefs = listItems + .map(function(){ + return this.id.slice(3); + }).get(); + if (currentRefs.length === 0) { + for (var i=0,ilen=resultsData.length;i 0) { + tokens.push( + new lunr.Token (str.slice(sliceStart, sliceEnd), { + position: [sliceStart, sliceLength], + index: tokens.length + }) + ) + } + + sliceStart = sliceEnd + 1 + } + + } + + return tokens +} + +/** + * The separator used to split a string into tokens. Override this property to change the behaviour of + * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens. + * + * @static + * @see lunr.tokenizer + */ +lunr.tokenizer.separator = /[\s\-]+/ +/*! + * lunr.Pipeline + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.Pipelines maintain an ordered list of functions to be applied to all + * tokens in documents entering the search index and queries being ran against + * the index. + * + * An instance of lunr.Index created with the lunr shortcut will contain a + * pipeline with a stop word filter and an English language stemmer. Extra + * functions can be added before or after either of these functions or these + * default functions can be removed. + * + * When run the pipeline will call each function in turn, passing a token, the + * index of that token in the original list of all tokens and finally a list of + * all the original tokens. + * + * The output of functions in the pipeline will be passed to the next function + * in the pipeline. To exclude a token from entering the index the function + * should return undefined, the rest of the pipeline will not be called with + * this token. + * + * For serialisation of pipelines to work, all functions used in an instance of + * a pipeline should be registered with lunr.Pipeline. Registered functions can + * then be loaded. If trying to load a serialised pipeline that uses functions + * that are not registered an error will be thrown. + * + * If not planning on serialising the pipeline then registering pipeline functions + * is not necessary. + * + * @constructor + */ +lunr.Pipeline = function () { + this._stack = [] +} + +lunr.Pipeline.registeredFunctions = Object.create(null) + +/** + * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token + * string as well as all known metadata. A pipeline function can mutate the token string + * or mutate (or add) metadata for a given token. + * + * A pipeline function can indicate that the passed token should be discarded by returning + * null. This token will not be passed to any downstream pipeline functions and will not be + * added to the index. + * + * Multiple tokens can be returned by returning an array of tokens. Each token will be passed + * to any downstream pipeline functions and all will returned tokens will be added to the index. + * + * Any number of pipeline functions may be chained together using a lunr.Pipeline. + * + * @interface lunr.PipelineFunction + * @param {lunr.Token} token - A token from the document being processed. + * @param {number} i - The index of this token in the complete list of tokens for this document/field. + * @param {lunr.Token[]} tokens - All tokens for this document/field. + * @returns {(?lunr.Token|lunr.Token[])} + */ + +/** + * Register a function with the pipeline. + * + * Functions that are used in the pipeline should be registered if the pipeline + * needs to be serialised, or a serialised pipeline needs to be loaded. + * + * Registering a function does not add it to a pipeline, functions must still be + * added to instances of the pipeline for them to be used when running a pipeline. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @param {String} label - The label to register this function with + */ +lunr.Pipeline.registerFunction = function (fn, label) { + if (label in this.registeredFunctions) { + lunr.utils.warn('Overwriting existing registered function: ' + label) + } + + fn.label = label + lunr.Pipeline.registeredFunctions[fn.label] = fn +} + +/** + * Warns if the function is not registered as a Pipeline function. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @private + */ +lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { + var isRegistered = fn.label && (fn.label in this.registeredFunctions) + + if (!isRegistered) { + lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + } +} + +/** + * Loads a previously serialised pipeline. + * + * All functions to be loaded must already be registered with lunr.Pipeline. + * If any function from the serialised data has not been registered then an + * error will be thrown. + * + * @param {Object} serialised - The serialised pipeline to load. + * @returns {lunr.Pipeline} + */ +lunr.Pipeline.load = function (serialised) { + var pipeline = new lunr.Pipeline + + serialised.forEach(function (fnName) { + var fn = lunr.Pipeline.registeredFunctions[fnName] + + if (fn) { + pipeline.add(fn) + } else { + throw new Error('Cannot load unregistered function: ' + fnName) + } + }) + + return pipeline +} + +/** + * Adds new functions to the end of the pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. + */ +lunr.Pipeline.prototype.add = function () { + var fns = Array.prototype.slice.call(arguments) + + fns.forEach(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + this._stack.push(fn) + }, this) +} + +/** + * Adds a single function after a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.after = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + pos = pos + 1 + this._stack.splice(pos, 0, newFn) +} + +/** + * Adds a single function before a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.before = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + this._stack.splice(pos, 0, newFn) +} + +/** + * Removes a function from the pipeline. + * + * @param {lunr.PipelineFunction} fn The function to remove from the pipeline. + */ +lunr.Pipeline.prototype.remove = function (fn) { + var pos = this._stack.indexOf(fn) + if (pos == -1) { + return + } + + this._stack.splice(pos, 1) +} + +/** + * Runs the current list of functions that make up the pipeline against the + * passed tokens. + * + * @param {Array} tokens The tokens to run through the pipeline. + * @returns {Array} + */ +lunr.Pipeline.prototype.run = function (tokens) { + var stackLength = this._stack.length + + for (var i = 0; i < stackLength; i++) { + var fn = this._stack[i] + + tokens = tokens.reduce(function (memo, token, j) { + var result = fn(token, j, tokens) + + if (result === void 0 || result === '') return memo + + return memo.concat(result) + }, []) + } + + return tokens +} + +/** + * Convenience method for passing a string through a pipeline and getting + * strings out. This method takes care of wrapping the passed string in a + * token and mapping the resulting tokens back to strings. + * + * @param {string} str - The string to pass through the pipeline. + * @returns {string[]} + */ +lunr.Pipeline.prototype.runString = function (str) { + var token = new lunr.Token (str) + + return this.run([token]).map(function (t) { + return t.toString() + }) +} + +/** + * Resets the pipeline by removing any existing processors. + * + */ +lunr.Pipeline.prototype.reset = function () { + this._stack = [] +} + +/** + * Returns a representation of the pipeline ready for serialisation. + * + * Logs a warning if the function has not been registered. + * + * @returns {Array} + */ +lunr.Pipeline.prototype.toJSON = function () { + return this._stack.map(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + + return fn.label + }) +} +/*! + * lunr.Vector + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * A vector is used to construct the vector space of documents and queries. These + * vectors support operations to determine the similarity between two documents or + * a document and a query. + * + * Normally no parameters are required for initializing a vector, but in the case of + * loading a previously dumped vector the raw elements can be provided to the constructor. + * + * For performance reasons vectors are implemented with a flat array, where an elements + * index is immediately followed by its value. E.g. [index, value, index, value]. This + * allows the underlying array to be as sparse as possible and still offer decent + * performance when being used for vector calculations. + * + * @constructor + * @param {Number[]} [elements] - The flat list of element index and element value pairs. + */ +lunr.Vector = function (elements) { + this._magnitude = 0 + this.elements = elements || [] +} + + +/** + * Calculates the position within the vector to insert a given index. + * + * This is used internally by insert and upsert. If there are duplicate indexes then + * the position is returned as if the value for that index were to be updated, but it + * is the callers responsibility to check whether there is a duplicate at that index + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @returns {Number} + */ +lunr.Vector.prototype.positionForIndex = function (index) { + // For an empty vector the tuple can be inserted at the beginning + if (this.elements.length == 0) { + return 0 + } + + var start = 0, + end = this.elements.length / 2, + sliceLength = end - start, + pivotPoint = Math.floor(sliceLength / 2), + pivotIndex = this.elements[pivotPoint * 2] + + while (sliceLength > 1) { + if (pivotIndex < index) { + start = pivotPoint + } + + if (pivotIndex > index) { + end = pivotPoint + } + + if (pivotIndex == index) { + break + } + + sliceLength = end - start + pivotPoint = start + Math.floor(sliceLength / 2) + pivotIndex = this.elements[pivotPoint * 2] + } + + if (pivotIndex == index) { + return pivotPoint * 2 + } + + if (pivotIndex > index) { + return pivotPoint * 2 + } + + if (pivotIndex < index) { + return (pivotPoint + 1) * 2 + } +} + +/** + * Inserts an element at an index within the vector. + * + * Does not allow duplicates, will throw an error if there is already an entry + * for this index. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + */ +lunr.Vector.prototype.insert = function (insertIdx, val) { + this.upsert(insertIdx, val, function () { + throw "duplicate index" + }) +} + +/** + * Inserts or updates an existing index within the vector. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + * @param {function} fn - A function that is called for updates, the existing value and the + * requested value are passed as arguments + */ +lunr.Vector.prototype.upsert = function (insertIdx, val, fn) { + this._magnitude = 0 + var position = this.positionForIndex(insertIdx) + + if (this.elements[position] == insertIdx) { + this.elements[position + 1] = fn(this.elements[position + 1], val) + } else { + this.elements.splice(position, 0, insertIdx, val) + } +} + +/** + * Calculates the magnitude of this vector. + * + * @returns {Number} + */ +lunr.Vector.prototype.magnitude = function () { + if (this._magnitude) return this._magnitude + + var sumOfSquares = 0, + elementsLength = this.elements.length + + for (var i = 1; i < elementsLength; i += 2) { + var val = this.elements[i] + sumOfSquares += val * val + } + + return this._magnitude = Math.sqrt(sumOfSquares) +} + +/** + * Calculates the dot product of this vector and another vector. + * + * @param {lunr.Vector} otherVector - The vector to compute the dot product with. + * @returns {Number} + */ +lunr.Vector.prototype.dot = function (otherVector) { + var dotProduct = 0, + a = this.elements, b = otherVector.elements, + aLen = a.length, bLen = b.length, + aVal = 0, bVal = 0, + i = 0, j = 0 + + while (i < aLen && j < bLen) { + aVal = a[i], bVal = b[j] + if (aVal < bVal) { + i += 2 + } else if (aVal > bVal) { + j += 2 + } else if (aVal == bVal) { + dotProduct += a[i + 1] * b[j + 1] + i += 2 + j += 2 + } + } + + return dotProduct +} + +/** + * Calculates the cosine similarity between this vector and another + * vector. + * + * @param {lunr.Vector} otherVector - The other vector to calculate the + * similarity with. + * @returns {Number} + */ +lunr.Vector.prototype.similarity = function (otherVector) { + return this.dot(otherVector) / (this.magnitude() * otherVector.magnitude()) +} + +/** + * Converts the vector to an array of the elements within the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toArray = function () { + var output = new Array (this.elements.length / 2) + + for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) { + output[j] = this.elements[i] + } + + return output +} + +/** + * A JSON serializable representation of the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toJSON = function () { + return this.elements +} +/* eslint-disable */ +/*! + * lunr.stemmer + * Copyright (C) 2017 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ + +/** + * lunr.stemmer is an english language stemmer, this is a JavaScript + * implementation of the PorterStemmer taken from http://tartarus.org/~martin + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token - The string to stem + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stemmer = (function(){ + var step2list = { + "ational" : "ate", + "tional" : "tion", + "enci" : "ence", + "anci" : "ance", + "izer" : "ize", + "bli" : "ble", + "alli" : "al", + "entli" : "ent", + "eli" : "e", + "ousli" : "ous", + "ization" : "ize", + "ation" : "ate", + "ator" : "ate", + "alism" : "al", + "iveness" : "ive", + "fulness" : "ful", + "ousness" : "ous", + "aliti" : "al", + "iviti" : "ive", + "biliti" : "ble", + "logi" : "log" + }, + + step3list = { + "icate" : "ic", + "ative" : "", + "alize" : "al", + "iciti" : "ic", + "ical" : "ic", + "ful" : "", + "ness" : "" + }, + + c = "[^aeiou]", // consonant + v = "[aeiouy]", // vowel + C = c + "[^aeiouy]*", // consonant sequence + V = v + "[aeiou]*", // vowel sequence + + mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 + meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 + mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 + s_v = "^(" + C + ")?" + v; // vowel in stem + + var re_mgr0 = new RegExp(mgr0); + var re_mgr1 = new RegExp(mgr1); + var re_meq1 = new RegExp(meq1); + var re_s_v = new RegExp(s_v); + + var re_1a = /^(.+?)(ss|i)es$/; + var re2_1a = /^(.+?)([^s])s$/; + var re_1b = /^(.+?)eed$/; + var re2_1b = /^(.+?)(ed|ing)$/; + var re_1b_2 = /.$/; + var re2_1b_2 = /(at|bl|iz)$/; + var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$"); + var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var re_1c = /^(.+?[^aeiou])y$/; + var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + + var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + + var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + var re2_4 = /^(.+?)(s|t)(ion)$/; + + var re_5 = /^(.+?)e$/; + var re_5_1 = /ll$/; + var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var porterStemmer = function porterStemmer(w) { + var stem, + suffix, + firstch, + re, + re2, + re3, + re4; + + if (w.length < 3) { return w; } + + firstch = w.substr(0,1); + if (firstch == "y") { + w = firstch.toUpperCase() + w.substr(1); + } + + // Step 1a + re = re_1a + re2 = re2_1a; + + if (re.test(w)) { w = w.replace(re,"$1$2"); } + else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } + + // Step 1b + re = re_1b; + re2 = re2_1b; + if (re.test(w)) { + var fp = re.exec(w); + re = re_mgr0; + if (re.test(fp[1])) { + re = re_1b_2; + w = w.replace(re,""); + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = re_s_v; + if (re2.test(stem)) { + w = stem; + re2 = re2_1b_2; + re3 = re3_1b_2; + re4 = re4_1b_2; + if (re2.test(w)) { w = w + "e"; } + else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); } + else if (re4.test(w)) { w = w + "e"; } + } + } + + // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say) + re = re_1c; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "i"; + } + + // Step 2 + re = re_2; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step2list[suffix]; + } + } + + // Step 3 + re = re_3; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step3list[suffix]; + } + } + + // Step 4 + re = re_4; + re2 = re2_4; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + if (re.test(stem)) { + w = stem; + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = re_mgr1; + if (re2.test(stem)) { + w = stem; + } + } + + // Step 5 + re = re_5; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + re2 = re_meq1; + re3 = re3_5; + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { + w = stem; + } + } + + re = re_5_1; + re2 = re_mgr1; + if (re.test(w) && re2.test(w)) { + re = re_1b_2; + w = w.replace(re,""); + } + + // and turn initial Y back to y + + if (firstch == "y") { + w = firstch.toLowerCase() + w.substr(1); + } + + return w; + }; + + return function (token) { + return token.update(porterStemmer); + } +})(); + +lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') +/*! + * lunr.stopWordFilter + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.generateStopWordFilter builds a stopWordFilter function from the provided + * list of stop words. + * + * The built in lunr.stopWordFilter is built using this generator and can be used + * to generate custom stopWordFilters for applications or non English languages. + * + * @param {Array} token The token to pass through the filter + * @returns {lunr.PipelineFunction} + * @see lunr.Pipeline + * @see lunr.stopWordFilter + */ +lunr.generateStopWordFilter = function (stopWords) { + var words = stopWords.reduce(function (memo, stopWord) { + memo[stopWord] = stopWord + return memo + }, {}) + + return function (token) { + if (token && words[token.toString()] !== token.toString()) return token + } +} + +/** + * lunr.stopWordFilter is an English language stop word list filter, any words + * contained in the list will not be passed through the filter. + * + * This is intended to be used in the Pipeline. If the token does not pass the + * filter then undefined will be returned. + * + * @implements {lunr.PipelineFunction} + * @params {lunr.Token} token - A token to check for being a stop word. + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stopWordFilter = lunr.generateStopWordFilter([ + 'a', + 'able', + 'about', + 'across', + 'after', + 'all', + 'almost', + 'also', + 'am', + 'among', + 'an', + 'and', + 'any', + 'are', + 'as', + 'at', + 'be', + 'because', + 'been', + 'but', + 'by', + 'can', + 'cannot', + 'could', + 'dear', + 'did', + 'do', + 'does', + 'either', + 'else', + 'ever', + 'every', + 'for', + 'from', + 'get', + 'got', + 'had', + 'has', + 'have', + 'he', + 'her', + 'hers', + 'him', + 'his', + 'how', + 'however', + 'i', + 'if', + 'in', + 'into', + 'is', + 'it', + 'its', + 'just', + 'least', + 'let', + 'like', + 'likely', + 'may', + 'me', + 'might', + 'most', + 'must', + 'my', + 'neither', + 'no', + 'nor', + 'not', + 'of', + 'off', + 'often', + 'on', + 'only', + 'or', + 'other', + 'our', + 'own', + 'rather', + 'said', + 'say', + 'says', + 'she', + 'should', + 'since', + 'so', + 'some', + 'than', + 'that', + 'the', + 'their', + 'them', + 'then', + 'there', + 'these', + 'they', + 'this', + 'tis', + 'to', + 'too', + 'twas', + 'us', + 'wants', + 'was', + 'we', + 'were', + 'what', + 'when', + 'where', + 'which', + 'while', + 'who', + 'whom', + 'why', + 'will', + 'with', + 'would', + 'yet', + 'you', + 'your' +]) + +lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') +/*! + * lunr.trimmer + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.trimmer is a pipeline function for trimming non word + * characters from the beginning and end of tokens before they + * enter the index. + * + * This implementation may not work correctly for non latin + * characters and should either be removed or adapted for use + * with languages with non-latin characters. + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token The token to pass through the filter + * @returns {lunr.Token} + * @see lunr.Pipeline + */ +lunr.trimmer = function (token) { + return token.update(function (s) { + return s.replace(/^\W+/, '').replace(/\W+$/, '') + }) +} + +lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') +/*! + * lunr.TokenSet + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * A token set is used to store the unique list of all tokens + * within an index. Token sets are also used to represent an + * incoming query to the index, this query token set and index + * token set are then intersected to find which tokens to look + * up in the inverted index. + * + * A token set can hold multiple tokens, as in the case of the + * index token set, or it can hold a single token as in the + * case of a simple query token set. + * + * Additionally token sets are used to perform wildcard matching. + * Leading, contained and trailing wildcards are supported, and + * from this edit distance matching can also be provided. + * + * Token sets are implemented as a minimal finite state automata, + * where both common prefixes and suffixes are shared between tokens. + * This helps to reduce the space used for storing the token set. + * + * @constructor + */ +lunr.TokenSet = function () { + this.final = false + this.edges = {} + this.id = lunr.TokenSet._nextId + lunr.TokenSet._nextId += 1 +} + +/** + * Keeps track of the next, auto increment, identifier to assign + * to a new tokenSet. + * + * TokenSets require a unique identifier to be correctly minimised. + * + * @private + */ +lunr.TokenSet._nextId = 1 + +/** + * Creates a TokenSet instance from the given sorted array of words. + * + * @param {String[]} arr - A sorted array of strings to create the set from. + * @returns {lunr.TokenSet} + * @throws Will throw an error if the input array is not sorted. + */ +lunr.TokenSet.fromArray = function (arr) { + var builder = new lunr.TokenSet.Builder + + for (var i = 0, len = arr.length; i < len; i++) { + builder.insert(arr[i]) + } + + builder.finish() + return builder.root +} + +/** + * Creates a token set from a query clause. + * + * @private + * @param {Object} clause - A single clause from lunr.Query. + * @param {string} clause.term - The query clause term. + * @param {number} [clause.editDistance] - The optional edit distance for the term. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromClause = function (clause) { + if ('editDistance' in clause) { + return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance) + } else { + return lunr.TokenSet.fromString(clause.term) + } +} + +/** + * Creates a token set representing a single string with a specified + * edit distance. + * + * Insertions, deletions, substitutions and transpositions are each + * treated as an edit distance of 1. + * + * Increasing the allowed edit distance will have a dramatic impact + * on the performance of both creating and intersecting these TokenSets. + * It is advised to keep the edit distance less than 3. + * + * @param {string} str - The string to create the token set from. + * @param {number} editDistance - The allowed edit distance to match. + * @returns {lunr.Vector} + */ +lunr.TokenSet.fromFuzzyString = function (str, editDistance) { + var root = new lunr.TokenSet + + var stack = [{ + node: root, + editsRemaining: editDistance, + str: str + }] + + while (stack.length) { + var frame = stack.pop() + + // no edit + if (frame.str.length > 0) { + var char = frame.str.charAt(0), + noEditNode + + if (char in frame.node.edges) { + noEditNode = frame.node.edges[char] + } else { + noEditNode = new lunr.TokenSet + frame.node.edges[char] = noEditNode + } + + if (frame.str.length == 1) { + noEditNode.final = true + } else { + stack.push({ + node: noEditNode, + editsRemaining: frame.editsRemaining, + str: frame.str.slice(1) + }) + } + } + + // deletion + // can only do a deletion if we have enough edits remaining + // and if there are characters left to delete in the string + if (frame.editsRemaining > 0 && frame.str.length > 1) { + var char = frame.str.charAt(1), + deletionNode + + if (char in frame.node.edges) { + deletionNode = frame.node.edges[char] + } else { + deletionNode = new lunr.TokenSet + frame.node.edges[char] = deletionNode + } + + if (frame.str.length <= 2) { + deletionNode.final = true + } else { + stack.push({ + node: deletionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(2) + }) + } + } + + // deletion + // just removing the last character from the str + if (frame.editsRemaining > 0 && frame.str.length == 1) { + frame.node.final = true + } + + // substitution + // can only do a substitution if we have enough edits remaining + // and if there are characters left to substitute + if (frame.editsRemaining > 0 && frame.str.length >= 1) { + if ("*" in frame.node.edges) { + var substitutionNode = frame.node.edges["*"] + } else { + var substitutionNode = new lunr.TokenSet + frame.node.edges["*"] = substitutionNode + } + + if (frame.str.length == 1) { + substitutionNode.final = true + } else { + stack.push({ + node: substitutionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + } + + // insertion + // can only do insertion if there are edits remaining + if (frame.editsRemaining > 0) { + if ("*" in frame.node.edges) { + var insertionNode = frame.node.edges["*"] + } else { + var insertionNode = new lunr.TokenSet + frame.node.edges["*"] = insertionNode + } + + if (frame.str.length == 0) { + insertionNode.final = true + } else { + stack.push({ + node: insertionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str + }) + } + } + + // transposition + // can only do a transposition if there are edits remaining + // and there are enough characters to transpose + if (frame.editsRemaining > 0 && frame.str.length > 1) { + var charA = frame.str.charAt(0), + charB = frame.str.charAt(1), + transposeNode + + if (charB in frame.node.edges) { + transposeNode = frame.node.edges[charB] + } else { + transposeNode = new lunr.TokenSet + frame.node.edges[charB] = transposeNode + } + + if (frame.str.length == 1) { + transposeNode.final = true + } else { + stack.push({ + node: transposeNode, + editsRemaining: frame.editsRemaining - 1, + str: charA + frame.str.slice(2) + }) + } + } + } + + return root +} + +/** + * Creates a TokenSet from a string. + * + * The string may contain one or more wildcard characters (*) + * that will allow wildcard matching when intersecting with + * another TokenSet. + * + * @param {string} str - The string to create a TokenSet from. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromString = function (str) { + var node = new lunr.TokenSet, + root = node, + wildcardFound = false + + /* + * Iterates through all characters within the passed string + * appending a node for each character. + * + * As soon as a wildcard character is found then a self + * referencing edge is introduced to continually match + * any number of any characters. + */ + for (var i = 0, len = str.length; i < len; i++) { + var char = str[i], + final = (i == len - 1) + + if (char == "*") { + wildcardFound = true + node.edges[char] = node + node.final = final + + } else { + var next = new lunr.TokenSet + next.final = final + + node.edges[char] = next + node = next + + // TODO: is this needed anymore? + if (wildcardFound) { + node.edges["*"] = root + } + } + } + + return root +} + +/** + * Converts this TokenSet into an array of strings + * contained within the TokenSet. + * + * @returns {string[]} + */ +lunr.TokenSet.prototype.toArray = function () { + var words = [] + + var stack = [{ + prefix: "", + node: this + }] + + while (stack.length) { + var frame = stack.pop(), + edges = Object.keys(frame.node.edges), + len = edges.length + + if (frame.node.final) { + words.push(frame.prefix) + } + + for (var i = 0; i < len; i++) { + var edge = edges[i] + + stack.push({ + prefix: frame.prefix.concat(edge), + node: frame.node.edges[edge] + }) + } + } + + return words +} + +/** + * Generates a string representation of a TokenSet. + * + * This is intended to allow TokenSets to be used as keys + * in objects, largely to aid the construction and minimisation + * of a TokenSet. As such it is not designed to be a human + * friendly representation of the TokenSet. + * + * @returns {string} + */ +lunr.TokenSet.prototype.toString = function () { + // NOTE: Using Object.keys here as this.edges is very likely + // to enter 'hash-mode' with many keys being added + // + // avoiding a for-in loop here as it leads to the function + // being de-optimised (at least in V8). From some simple + // benchmarks the performance is comparable, but allowing + // V8 to optimize may mean easy performance wins in the future. + + if (this._str) { + return this._str + } + + var str = this.final ? '1' : '0', + labels = Object.keys(this.edges).sort(), + len = labels.length + + for (var i = 0; i < len; i++) { + var label = labels[i], + node = this.edges[label] + + str = str + label + node.id + } + + return str +} + +/** + * Returns a new TokenSet that is the intersection of + * this TokenSet and the passed TokenSet. + * + * This intersection will take into account any wildcards + * contained within the TokenSet. + * + * @param {lunr.TokenSet} b - An other TokenSet to intersect with. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.prototype.intersect = function (b) { + var output = new lunr.TokenSet, + frame = undefined + + var stack = [{ + qNode: b, + output: output, + node: this + }] + + while (stack.length) { + frame = stack.pop() + + // NOTE: As with the #toString method, we are using + // Object.keys and a for loop instead of a for-in loop + // as both of these objects enter 'hash' mode, causing + // the function to be de-optimised in V8 + var qEdges = Object.keys(frame.qNode.edges), + qLen = qEdges.length, + nEdges = Object.keys(frame.node.edges), + nLen = nEdges.length + + for (var q = 0; q < qLen; q++) { + var qEdge = qEdges[q] + + for (var n = 0; n < nLen; n++) { + var nEdge = nEdges[n] + + if (nEdge == qEdge || qEdge == '*') { + var node = frame.node.edges[nEdge], + qNode = frame.qNode.edges[qEdge], + final = node.final && qNode.final, + next = undefined + + if (nEdge in frame.output.edges) { + // an edge already exists for this character + // no need to create a new node, just set the finality + // bit unless this node is already final + next = frame.output.edges[nEdge] + next.final = next.final || final + + } else { + // no edge exists yet, must create one + // set the finality bit and insert it + // into the output + next = new lunr.TokenSet + next.final = final + frame.output.edges[nEdge] = next + } + + stack.push({ + qNode: qNode, + output: next, + node: node + }) + } + } + } + } + + return output +} +lunr.TokenSet.Builder = function () { + this.previousWord = "" + this.root = new lunr.TokenSet + this.uncheckedNodes = [] + this.minimizedNodes = {} +} + +lunr.TokenSet.Builder.prototype.insert = function (word) { + var node, + commonPrefix = 0 + + if (word < this.previousWord) { + throw new Error ("Out of order word insertion") + } + + for (var i = 0; i < word.length && i < this.previousWord.length; i++) { + if (word[i] != this.previousWord[i]) break + commonPrefix++ + } + + this.minimize(commonPrefix) + + if (this.uncheckedNodes.length == 0) { + node = this.root + } else { + node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child + } + + for (var i = commonPrefix; i < word.length; i++) { + var nextNode = new lunr.TokenSet, + char = word[i] + + node.edges[char] = nextNode + + this.uncheckedNodes.push({ + parent: node, + char: char, + child: nextNode + }) + + node = nextNode + } + + node.final = true + this.previousWord = word +} + +lunr.TokenSet.Builder.prototype.finish = function () { + this.minimize(0) +} + +lunr.TokenSet.Builder.prototype.minimize = function (downTo) { + for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) { + var node = this.uncheckedNodes[i], + childKey = node.child.toString() + + if (childKey in this.minimizedNodes) { + node.parent.edges[node.char] = this.minimizedNodes[childKey] + } else { + // Cache the key for this node since + // we know it can't change anymore + node.child._str = childKey + + this.minimizedNodes[childKey] = node.child + } + + this.uncheckedNodes.pop() + } +} +/*! + * lunr.Index + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * An index contains the built index of all documents and provides a query interface + * to the index. + * + * Usually instances of lunr.Index will not be created using this constructor, instead + * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be + * used to load previously built and serialized indexes. + * + * @constructor + * @param {Object} attrs - The attributes of the built search index. + * @param {Object} attrs.invertedIndex - An index of term/field to document reference. + * @param {Object} attrs.documentVectors - Document vectors keyed by document reference. + * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. + * @param {string[]} attrs.fields - The names of indexed document fields. + * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. + */ +lunr.Index = function (attrs) { + this.invertedIndex = attrs.invertedIndex + this.fieldVectors = attrs.fieldVectors + this.tokenSet = attrs.tokenSet + this.fields = attrs.fields + this.pipeline = attrs.pipeline +} + +/** + * A result contains details of a document matching a search query. + * @typedef {Object} lunr.Index~Result + * @property {string} ref - The reference of the document this result represents. + * @property {number} score - A number between 0 and 1 representing how similar this document is to the query. + * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match. + */ + +/** + * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple + * query language which itself is parsed into an instance of lunr.Query. + * + * For programmatically building queries it is advised to directly use lunr.Query, the query language + * is best used for human entered text rather than program generated text. + * + * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported + * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello' + * or 'world', though those that contain both will rank higher in the results. + * + * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can + * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding + * wildcards will increase the number of documents that will be found but can also have a negative + * impact on query performance, especially with wildcards at the beginning of a term. + * + * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term + * hello in the title field will match this query. Using a field not present in the index will lead + * to an error being thrown. + * + * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term + * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported + * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. + * Avoid large values for edit distance to improve query performance. + * + * To escape special characters the backslash character '\' can be used, this allows searches to include + * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead + * of attempting to apply a boost of 2 to the search term "foo". + * + * @typedef {string} lunr.Index~QueryString + * @example Simple single term query + * hello + * @example Multiple term query + * hello world + * @example term scoped to a field + * title:hello + * @example term with a boost of 10 + * hello^10 + * @example term with an edit distance of 2 + * hello~2 + */ + +/** + * Performs a search against the index using lunr query syntax. + * + * Results will be returned sorted by their score, the most relevant results + * will be returned first. + * + * For more programmatic querying use lunr.Index#query. + * + * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. + * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.search = function (queryString) { + return this.query(function (query) { + var parser = new lunr.QueryParser(queryString, query) + parser.parse() + }) +} + +/** + * A query builder callback provides a query object to be used to express + * the query to perform on the index. + * + * @callback lunr.Index~queryBuilder + * @param {lunr.Query} query - The query object to build up. + * @this lunr.Query + */ + +/** + * Performs a query against the index using the yielded lunr.Query object. + * + * If performing programmatic queries against the index, this method is preferred + * over lunr.Index#search so as to avoid the additional query parsing overhead. + * + * A query object is yielded to the supplied function which should be used to + * express the query to be run against the index. + * + * Note that although this function takes a callback parameter it is _not_ an + * asynchronous operation, the callback is just yielded a query object to be + * customized. + * + * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.query = function (fn) { + // for each query clause + // * process terms + // * expand terms from token set + // * find matching documents and metadata + // * get document vectors + // * score documents + + var query = new lunr.Query(this.fields), + matchingFields = Object.create(null), + queryVectors = Object.create(null), + termFieldCache = Object.create(null) + + fn.call(query, query) + + for (var i = 0; i < query.clauses.length; i++) { + /* + * Unless the pipeline has been disabled for this term, which is + * the case for terms with wildcards, we need to pass the clause + * term through the search pipeline. A pipeline returns an array + * of processed terms. Pipeline functions may expand the passed + * term, which means we may end up performing multiple index lookups + * for a single query term. + */ + var clause = query.clauses[i], + terms = null + + if (clause.usePipeline) { + terms = this.pipeline.runString(clause.term) + } else { + terms = [clause.term] + } + + for (var m = 0; m < terms.length; m++) { + var term = terms[m] + + /* + * Each term returned from the pipeline needs to use the same query + * clause object, e.g. the same boost and or edit distance. The + * simplest way to do this is to re-use the clause object but mutate + * its term property. + */ + + clause = JSON.parse(JSON.stringify(clause)) + clause.term = term + + /* + * From the term in the clause we create a token set which will then + * be used to intersect the indexes token set to get a list of terms + * to lookup in the inverted index + */ + var termTokenSet = lunr.TokenSet.fromClause(clause), + expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() + + for (var j = 0; j < expandedTerms.length; j++) { + /* + * For each term get the posting and termIndex, this is required for + * building the query vector. + */ + var expandedTerm = expandedTerms[j]; + var posting = this.invertedIndex[expandedTerm]; + if (posting) { + var termIndex = posting._index; + } else { + continue; + } + for (var k = 0; k < clause.fields.length; k++) { + /* + * For each field that this query term is scoped by (by default + * all fields are in scope) we need to get all the document refs + * that have this term in that field. + * + * The posting is the entry in the invertedIndex for the matching + * term from above. + */ + var field = clause.fields[k], + fieldPosting = posting[field], + matchingDocumentRefs = Object.keys(fieldPosting), + termField = expandedTerm + "/" + field + + /* + * To support field level boosts a query vector is created per + * field. This vector is populated using the termIndex found for + * the term and a unit value with the appropriate boost applied. + * + * If the query vector for this field does not exist yet it needs + * to be created. + */ + if (queryVectors[field] === undefined) { + queryVectors[field] = new lunr.Vector + } + + /* + * Using upsert because there could already be an entry in the vector + * for the term we are working with. In that case we just add the scores + * together. + */ + queryVectors[field].upsert(termIndex, 1 * clause.boost, function (a, b) { return a + b }) + + /** + * If we've already seen this term, field combo then we've already collected + * the matching documents and metadata, no need to go through all that again + */ + if (termFieldCache[termField]) { + continue + } + + for (var l = 0; l < matchingDocumentRefs.length; l++) { + /* + * All metadata for this term/field/document triple + * are then extracted and collected into an instance + * of lunr.MatchData ready to be returned in the query + * results + */ + var matchingDocumentRef = matchingDocumentRefs[l], + matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field), + metadata = fieldPosting[matchingDocumentRef], + fieldMatch + + if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) { + matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata) + } else { + fieldMatch.add(expandedTerm, field, metadata) + } + + } + + termFieldCache[termField] = true + } + } + } + } + + var matchingFieldRefs = Object.keys(matchingFields), + results = [], + matches = Object.create(null) + + for (var i = 0; i < matchingFieldRefs.length; i++) { + /* + * Currently we have document fields that match the query, but we + * need to return documents. The matchData and scores are combined + * from multiple fields belonging to the same document. + * + * Scores are calculated by field, using the query vectors created + * above, and combined into a final document score using addition. + */ + var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), + docRef = fieldRef.docRef, + fieldVector = this.fieldVectors[fieldRef], + score = queryVectors[fieldRef.fieldName].similarity(fieldVector), + docMatch + + if ((docMatch = matches[docRef]) !== undefined) { + docMatch.score += score + docMatch.matchData.combine(matchingFields[fieldRef]) + } else { + var match = { + ref: docRef, + score: score, + matchData: matchingFields[fieldRef] + } + matches[docRef] = match + results.push(match) + } + } + + /* + * Sort the results objects by score, highest first. + */ + return results.sort(function (a, b) { + return b.score - a.score + }) +} + +/** + * Prepares the index for JSON serialization. + * + * The schema for this JSON blob will be described in a + * separate JSON schema file. + * + * @returns {Object} + */ +lunr.Index.prototype.toJSON = function () { + var invertedIndex = Object.keys(this.invertedIndex) + .sort() + .map(function (term) { + return [term, this.invertedIndex[term]] + }, this) + + var fieldVectors = Object.keys(this.fieldVectors) + .map(function (ref) { + return [ref, this.fieldVectors[ref].toJSON()] + }, this) + + return { + version: lunr.version, + fields: this.fields, + fieldVectors: fieldVectors, + invertedIndex: invertedIndex, + pipeline: this.pipeline.toJSON() + } +} + +/** + * Loads a previously serialized lunr.Index + * + * @param {Object} serializedIndex - A previously serialized lunr.Index + * @returns {lunr.Index} + */ +lunr.Index.load = function (serializedIndex) { + var attrs = {}, + fieldVectors = {}, + serializedVectors = serializedIndex.fieldVectors, + invertedIndex = {}, + serializedInvertedIndex = serializedIndex.invertedIndex, + tokenSetBuilder = new lunr.TokenSet.Builder, + pipeline = lunr.Pipeline.load(serializedIndex.pipeline) + + if (serializedIndex.version != lunr.version) { + lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + } + + for (var i = 0; i < serializedVectors.length; i++) { + var tuple = serializedVectors[i], + ref = tuple[0], + elements = tuple[1] + + fieldVectors[ref] = new lunr.Vector(elements) + } + + for (var i = 0; i < serializedInvertedIndex.length; i++) { + var tuple = serializedInvertedIndex[i], + term = tuple[0], + posting = tuple[1] + + tokenSetBuilder.insert(term) + invertedIndex[term] = posting + } + + tokenSetBuilder.finish() + + attrs.fields = serializedIndex.fields + + attrs.fieldVectors = fieldVectors + attrs.invertedIndex = invertedIndex + attrs.tokenSet = tokenSetBuilder.root + attrs.pipeline = pipeline + + return new lunr.Index(attrs) +} +/*! + * lunr.Builder + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.Builder performs indexing on a set of documents and + * returns instances of lunr.Index ready for querying. + * + * All configuration of the index is done via the builder, the + * fields to index, the document reference, the text processing + * pipeline and document scoring parameters are all set on the + * builder before indexing. + * + * @constructor + * @property {string} _ref - Internal reference to the document reference field. + * @property {string[]} _fields - Internal reference to the document fields to index. + * @property {object} invertedIndex - The inverted index maps terms to document fields. + * @property {object} documentTermFrequencies - Keeps track of document term frequencies. + * @property {object} documentLengths - Keeps track of the length of documents added to the index. + * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing. + * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing. + * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index. + * @property {number} documentCount - Keeps track of the total number of documents indexed. + * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75. + * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2. + * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space. + * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index. + */ +lunr.Builder = function () { + this._ref = "id" + this._fields = [] + this.invertedIndex = Object.create(null) + this.fieldTermFrequencies = {} + this.fieldLengths = {} + this.tokenizer = lunr.tokenizer + this.pipeline = new lunr.Pipeline + this.searchPipeline = new lunr.Pipeline + this.documentCount = 0 + this._b = 0.75 + this._k1 = 1.2 + this.termIndex = 0 + this.metadataWhitelist = [] +} + +/** + * Sets the document field used as the document reference. Every document must have this field. + * The type of this field in the document should be a string, if it is not a string it will be + * coerced into a string by calling toString. + * + * The default ref is 'id'. + * + * The ref should _not_ be changed during indexing, it should be set before any documents are + * added to the index. Changing it during indexing can lead to inconsistent results. + * + * @param {string} ref - The name of the reference field in the document. + */ +lunr.Builder.prototype.ref = function (ref) { + this._ref = ref +} + +/** + * Adds a field to the list of document fields that will be indexed. Every document being + * indexed should have this field. Null values for this field in indexed documents will + * not cause errors but will limit the chance of that document being retrieved by searches. + * + * All fields should be added before adding documents to the index. Adding fields after + * a document has been indexed will have no effect on already indexed documents. + * + * @param {string} field - The name of a field to index in all documents. + */ +lunr.Builder.prototype.field = function (field) { + this._fields.push(field) +} + +/** + * A parameter to tune the amount of field length normalisation that is applied when + * calculating relevance scores. A value of 0 will completely disable any normalisation + * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b + * will be clamped to the range 0 - 1. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.b = function (number) { + if (number < 0) { + this._b = 0 + } else if (number > 1) { + this._b = 1 + } else { + this._b = number + } +} + +/** + * A parameter that controls the speed at which a rise in term frequency results in term + * frequency saturation. The default value is 1.2. Setting this to a higher value will give + * slower saturation levels, a lower value will result in quicker saturation. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.k1 = function (number) { + this._k1 = number +} + +/** + * Adds a document to the index. + * + * Before adding fields to the index the index should have been fully setup, with the document + * ref and all fields to index already having been specified. + * + * The document must have a field name as specified by the ref (by default this is 'id') and + * it should have all fields defined for indexing, though null or undefined values will not + * cause errors. + * + * @param {object} doc - The document to add to the index. + */ +lunr.Builder.prototype.add = function (doc) { + var docRef = doc[this._ref] + + this.documentCount += 1 + + for (var i = 0; i < this._fields.length; i++) { + var fieldName = this._fields[i], + field = doc[fieldName], + tokens = this.tokenizer(field), + terms = this.pipeline.run(tokens), + fieldRef = new lunr.FieldRef (docRef, fieldName), + fieldTerms = Object.create(null) + + this.fieldTermFrequencies[fieldRef] = fieldTerms + this.fieldLengths[fieldRef] = 0 + + // store the length of this field for this document + this.fieldLengths[fieldRef] += terms.length + + // calculate term frequencies for this field + for (var j = 0; j < terms.length; j++) { + var term = terms[j] + + if (fieldTerms[term] == undefined) { + fieldTerms[term] = 0 + } + + fieldTerms[term] += 1 + + // add to inverted index + // create an initial posting if one doesn't exist + if (this.invertedIndex[term] == undefined) { + var posting = Object.create(null) + posting["_index"] = this.termIndex + this.termIndex += 1 + + for (var k = 0; k < this._fields.length; k++) { + posting[this._fields[k]] = Object.create(null) + } + + this.invertedIndex[term] = posting + } + + // add an entry for this term/fieldName/docRef to the invertedIndex + if (this.invertedIndex[term][fieldName][docRef] == undefined) { + this.invertedIndex[term][fieldName][docRef] = Object.create(null) + } + + // store all whitelisted metadata about this token in the + // inverted index + for (var l = 0; l < this.metadataWhitelist.length; l++) { + var metadataKey = this.metadataWhitelist[l], + metadata = term.metadata[metadataKey] + + if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) { + this.invertedIndex[term][fieldName][docRef][metadataKey] = [] + } + + this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata) + } + } + + } +} + +/** + * Calculates the average document length for this index + * + * @private + */ +lunr.Builder.prototype.calculateAverageFieldLengths = function () { + + var fieldRefs = Object.keys(this.fieldLengths), + numberOfFields = fieldRefs.length, + accumulator = {}, + documentsWithField = {} + + for (var i = 0; i < numberOfFields; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName + + documentsWithField[field] || (documentsWithField[field] = 0) + documentsWithField[field] += 1 + + accumulator[field] || (accumulator[field] = 0) + accumulator[field] += this.fieldLengths[fieldRef] + } + + for (var i = 0; i < this._fields.length; i++) { + var field = this._fields[i] + accumulator[field] = accumulator[field] / documentsWithField[field] + } + + this.averageFieldLength = accumulator +} + +/** + * Builds a vector space model of every document using lunr.Vector + * + * @private + */ +lunr.Builder.prototype.createFieldVectors = function () { + var fieldVectors = {}, + fieldRefs = Object.keys(this.fieldTermFrequencies), + fieldRefsLength = fieldRefs.length, + termIdfCache = Object.create(null) + + for (var i = 0; i < fieldRefsLength; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName, + fieldLength = this.fieldLengths[fieldRef], + fieldVector = new lunr.Vector, + termFrequencies = this.fieldTermFrequencies[fieldRef], + terms = Object.keys(termFrequencies), + termsLength = terms.length + + for (var j = 0; j < termsLength; j++) { + var term = terms[j], + tf = termFrequencies[term], + termIndex = this.invertedIndex[term]._index, + idf, score, scoreWithPrecision + + if (termIdfCache[term] === undefined) { + idf = lunr.idf(this.invertedIndex[term], this.documentCount) + termIdfCache[term] = idf + } else { + idf = termIdfCache[term] + } + + score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[field])) + tf) + scoreWithPrecision = Math.round(score * 1000) / 1000 + // Converts 1.23456789 to 1.234. + // Reducing the precision so that the vectors take up less + // space when serialised. Doing it now so that they behave + // the same before and after serialisation. Also, this is + // the fastest approach to reducing a number's precision in + // JavaScript. + + fieldVector.insert(termIndex, scoreWithPrecision) + } + + fieldVectors[fieldRef] = fieldVector + } + + this.fieldVectors = fieldVectors +} + +/** + * Creates a token set of all tokens in the index using lunr.TokenSet + * + * @private + */ +lunr.Builder.prototype.createTokenSet = function () { + this.tokenSet = lunr.TokenSet.fromArray( + Object.keys(this.invertedIndex).sort() + ) +} + +/** + * Builds the index, creating an instance of lunr.Index. + * + * This completes the indexing process and should only be called + * once all documents have been added to the index. + * + * @returns {lunr.Index} + */ +lunr.Builder.prototype.build = function () { + this.calculateAverageFieldLengths() + this.createFieldVectors() + this.createTokenSet() + + return new lunr.Index({ + invertedIndex: this.invertedIndex, + fieldVectors: this.fieldVectors, + tokenSet: this.tokenSet, + fields: this._fields, + pipeline: this.searchPipeline + }) +} + +/** + * Applies a plugin to the index builder. + * + * A plugin is a function that is called with the index builder as its context. + * Plugins can be used to customise or extend the behaviour of the index + * in some way. A plugin is just a function, that encapsulated the custom + * behaviour that should be applied when building the index. + * + * The plugin function will be called with the index builder as its argument, additional + * arguments can also be passed when calling use. The function will be called + * with the index builder as its context. + * + * @param {Function} plugin The plugin to apply. + */ +lunr.Builder.prototype.use = function (fn) { + var args = Array.prototype.slice.call(arguments, 1) + args.unshift(this) + fn.apply(this, args) +} +/** + * Contains and collects metadata about a matching document. + * A single instance of lunr.MatchData is returned as part of every + * lunr.Index~Result. + * + * @constructor + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + * @property {object} metadata - A cloned collection of metadata associated with this document. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData = function (term, field, metadata) { + var clonedMetadata = Object.create(null), + metadataKeys = Object.keys(metadata) + + // Cloning the metadata to prevent the original + // being mutated during match data combination. + // Metadata is kept in an array within the inverted + // index so cloning the data can be done with + // Array#slice + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + clonedMetadata[key] = metadata[key].slice() + } + + this.metadata = Object.create(null) + this.metadata[term] = Object.create(null) + this.metadata[term][field] = clonedMetadata +} + +/** + * An instance of lunr.MatchData will be created for every term that matches a + * document. However only one instance is required in a lunr.Index~Result. This + * method combines metadata from another instance of lunr.MatchData with this + * objects metadata. + * + * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData.prototype.combine = function (otherMatchData) { + var terms = Object.keys(otherMatchData.metadata) + + for (var i = 0; i < terms.length; i++) { + var term = terms[i], + fields = Object.keys(otherMatchData.metadata[term]) + + if (this.metadata[term] == undefined) { + this.metadata[term] = Object.create(null) + } + + for (var j = 0; j < fields.length; j++) { + var field = fields[j], + keys = Object.keys(otherMatchData.metadata[term][field]) + + if (this.metadata[term][field] == undefined) { + this.metadata[term][field] = Object.create(null) + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k] + + if (this.metadata[term][field][key] == undefined) { + this.metadata[term][field][key] = otherMatchData.metadata[term][field][key] + } else { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key]) + } + + } + } + } +} + +/** + * Add metadata for a term/field pair to this instance of match data. + * + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + */ +lunr.MatchData.prototype.add = function (term, field, metadata) { + if (!(term in this.metadata)) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = metadata + return + } + + if (!(field in this.metadata[term])) { + this.metadata[term][field] = metadata + return + } + + var metadataKeys = Object.keys(metadata) + + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + + if (key in this.metadata[term][field]) { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key]) + } else { + this.metadata[term][field][key] = metadata[key] + } + } +} +/** + * A lunr.Query provides a programmatic way of defining queries to be performed + * against a {@link lunr.Index}. + * + * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method + * so the query object is pre-initialized with the right index fields. + * + * @constructor + * @property {lunr.Query~Clause[]} clauses - An array of query clauses. + * @property {string[]} allFields - An array of all available fields in a lunr.Index. + */ +lunr.Query = function (allFields) { + this.clauses = [] + this.allFields = allFields +} + +/** + * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause. + * + * This allows wildcards to be added to the beginning and end of a term without having to manually do any string + * concatenation. + * + * The wildcard constants can be bitwise combined to select both leading and trailing wildcards. + * + * @constant + * @default + * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour + * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists + * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with trailing wildcard + * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING }) + * @example query term with leading and trailing wildcard + * query.term('foo', { + * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING + * }) + */ +lunr.Query.wildcard = new String ("*") +lunr.Query.wildcard.NONE = 0 +lunr.Query.wildcard.LEADING = 1 +lunr.Query.wildcard.TRAILING = 2 + +/** + * A single clause in a {@link lunr.Query} contains a term and details on how to + * match that term against a {@link lunr.Index}. + * + * @typedef {Object} lunr.Query~Clause + * @property {string[]} fields - The fields in an index this clause should be matched against. + * @property {number} [boost=1] - Any boost that should be applied when matching this clause. + * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. + * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. + * @property {number} [wildcard=0] - Whether the term should have wildcards appended or prepended. + */ + +/** + * Adds a {@link lunr.Query~Clause} to this query. + * + * Unless the clause contains the fields to be matched all fields will be matched. In addition + * a default boost of 1 is applied to the clause. + * + * @param {lunr.Query~Clause} clause - The clause to add to this query. + * @see lunr.Query~Clause + * @returns {lunr.Query} + */ +lunr.Query.prototype.clause = function (clause) { + if (!('fields' in clause)) { + clause.fields = this.allFields + } + + if (!('boost' in clause)) { + clause.boost = 1 + } + + if (!('usePipeline' in clause)) { + clause.usePipeline = true + } + + if (!('wildcard' in clause)) { + clause.wildcard = lunr.Query.wildcard.NONE + } + + if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) { + clause.term = "*" + clause.term + } + + if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) { + clause.term = "" + clause.term + "*" + } + + this.clauses.push(clause) + + return this +} + +/** + * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} + * to the list of clauses that make up this query. + * + * @param {string} term - The term to add to the query. + * @param {Object} [options] - Any additional properties to add to the query clause. + * @returns {lunr.Query} + * @see lunr.Query#clause + * @see lunr.Query~Clause + * @example adding a single term to a query + * query.term("foo") + * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard + * query.term("foo", { + * fields: ["title"], + * boost: 10, + * wildcard: lunr.Query.wildcard.TRAILING + * }) + */ +lunr.Query.prototype.term = function (term, options) { + var clause = options || {} + clause.term = term + + this.clause(clause) + + return this +} +lunr.QueryParseError = function (message, start, end) { + this.name = "QueryParseError" + this.message = message + this.start = start + this.end = end +} + +lunr.QueryParseError.prototype = new Error +lunr.QueryLexer = function (str) { + this.lexemes = [] + this.str = str + this.length = str.length + this.pos = 0 + this.start = 0 + this.escapeCharPositions = [] +} + +lunr.QueryLexer.prototype.run = function () { + var state = lunr.QueryLexer.lexText + + while (state) { + state = state(this) + } +} + +lunr.QueryLexer.prototype.sliceString = function () { + var subSlices = [], + sliceStart = this.start, + sliceEnd = this.pos + + for (var i = 0; i < this.escapeCharPositions.length; i++) { + sliceEnd = this.escapeCharPositions[i] + subSlices.push(this.str.slice(sliceStart, sliceEnd)) + sliceStart = sliceEnd + 1 + } + + subSlices.push(this.str.slice(sliceStart, this.pos)) + this.escapeCharPositions.length = 0 + + return subSlices.join('') +} + +lunr.QueryLexer.prototype.emit = function (type) { + this.lexemes.push({ + type: type, + str: this.sliceString(), + start: this.start, + end: this.pos + }) + + this.start = this.pos +} + +lunr.QueryLexer.prototype.escapeCharacter = function () { + this.escapeCharPositions.push(this.pos - 1) + this.pos += 1 +} + +lunr.QueryLexer.prototype.next = function () { + if (this.pos >= this.length) { + return lunr.QueryLexer.EOS + } + + var char = this.str.charAt(this.pos) + this.pos += 1 + return char +} + +lunr.QueryLexer.prototype.width = function () { + return this.pos - this.start +} + +lunr.QueryLexer.prototype.ignore = function () { + if (this.start == this.pos) { + this.pos += 1 + } + + this.start = this.pos +} + +lunr.QueryLexer.prototype.backup = function () { + this.pos -= 1 +} + +lunr.QueryLexer.prototype.acceptDigitRun = function () { + var char, charCode + + do { + char = this.next() + charCode = char.charCodeAt(0) + } while (charCode > 47 && charCode < 58) + + if (char != lunr.QueryLexer.EOS) { + this.backup() + } +} + +lunr.QueryLexer.prototype.more = function () { + return this.pos < this.length +} + +lunr.QueryLexer.EOS = 'EOS' +lunr.QueryLexer.FIELD = 'FIELD' +lunr.QueryLexer.TERM = 'TERM' +lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' +lunr.QueryLexer.BOOST = 'BOOST' + +lunr.QueryLexer.lexField = function (lexer) { + lexer.backup() + lexer.emit(lunr.QueryLexer.FIELD) + lexer.ignore() + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexTerm = function (lexer) { + if (lexer.width() > 1) { + lexer.backup() + lexer.emit(lunr.QueryLexer.TERM) + } + + lexer.ignore() + + if (lexer.more()) { + return lunr.QueryLexer.lexText + } +} + +lunr.QueryLexer.lexEditDistance = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.EDIT_DISTANCE) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexBoost = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.BOOST) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexEOS = function (lexer) { + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } +} + +// This matches the separator used when tokenising fields +// within a document. These should match otherwise it is +// not possible to search for some tokens within a document. +// +// It is possible for the user to change the separator on the +// tokenizer so it _might_ clash with any other of the special +// characters already used within the search string, e.g. :. +// +// This means that it is possible to change the separator in +// such a way that makes some words unsearchable using a search +// string. +lunr.QueryLexer.termSeparator = lunr.tokenizer.separator + +lunr.QueryLexer.lexText = function (lexer) { + while (true) { + var char = lexer.next() + + if (char == lunr.QueryLexer.EOS) { + return lunr.QueryLexer.lexEOS + } + + // Escape character is '\' + if (char.charCodeAt(0) == 92) { + lexer.escapeCharacter() + continue + } + + if (char == ":") { + return lunr.QueryLexer.lexField + } + + if (char == "~") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexEditDistance + } + + if (char == "^") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexBoost + } + + if (char.match(lunr.QueryLexer.termSeparator)) { + return lunr.QueryLexer.lexTerm + } + } +} + +lunr.QueryParser = function (str, query) { + this.lexer = new lunr.QueryLexer (str) + this.query = query + this.currentClause = {} + this.lexemeIdx = 0 +} + +lunr.QueryParser.prototype.parse = function () { + this.lexer.run() + this.lexemes = this.lexer.lexemes + + var state = lunr.QueryParser.parseFieldOrTerm + + while (state) { + state = state(this) + } + + return this.query +} + +lunr.QueryParser.prototype.peekLexeme = function () { + return this.lexemes[this.lexemeIdx] +} + +lunr.QueryParser.prototype.consumeLexeme = function () { + var lexeme = this.peekLexeme() + this.lexemeIdx += 1 + return lexeme +} + +lunr.QueryParser.prototype.nextClause = function () { + var completedClause = this.currentClause + this.query.clause(completedClause) + this.currentClause = {} +} + +lunr.QueryParser.parseFieldOrTerm = function (parser) { + var lexeme = parser.peekLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.type) { + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expected either a field or a term, found " + lexeme.type + + if (lexeme.str.length >= 1) { + errorMessage += " with value '" + lexeme.str + "'" + } + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } +} + +lunr.QueryParser.parseField = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + if (parser.query.allFields.indexOf(lexeme.str) == -1) { + var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '), + errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.fields = [lexeme.str] + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseTerm = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + parser.currentClause.term = lexeme.str.toLowerCase() + + if (lexeme.str.indexOf("*") != -1) { + parser.currentClause.usePipeline = false + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseEditDistance = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var editDistance = parseInt(lexeme.str, 10) + + if (isNaN(editDistance)) { + var errorMessage = "edit distance must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.editDistance = editDistance + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseBoost = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var boost = parseInt(lexeme.str, 10) + + if (isNaN(boost)) { + var errorMessage = "boost must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.boost = boost + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + + /** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ + ;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like enviroments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + root.lunr = factory() + } + }(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + return lunr + })) +})(); + + + // Adapted from https://github.com/pseudonym117/Levenshtein +(function(root, factory){ + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + define(function(){ + return factory(root); + }); + } else if (typeof module == 'object' && module && module.exports) { + module.exports = factory(root); + } else { + root.Levenshtein = factory(root); + } +}(this, function(root){ + + function forEach( array, fn ) { var i, length + i = -1 + length = array.length + while ( ++i < length ) + fn( array[ i ], i, array ) + } + + function map( array, fn ) { var result + result = Array( array.length ) + forEach( array, function ( val, i, array ) { + result.push( fn( val, i, array ) ) + }) + return result + } + + function reduce( array, fn, accumulator ) { + forEach( array, function( val, i, array ) { + accumulator = fn( val, i, array ) + }) + return accumulator + } + + // For string mode + function getChar(str, idx) { + return str.charAt(idx); + } + + // For array mode + function getArrayMember(arr, idx) { + return arr[idx]; + } + + // Levenshtein distance + function Levenshtein( str_m, str_n ) { + var previous, current, matrix, getElem + // Set to string or array mode + if (typeof str_m === "string" && typeof str_n === "string") { + getElem = getChar; + } else if (typeof str_m === "object" && typeof str_n === "object") { + getElem = getArrayMember; + } else { + throw "Levensthtein: input must be two strings or two arrays" + } + // Constructor + matrix = this._matrix = [] + + // Sanity checks + if ( str_m == str_n ) + return this.distance = 0 + else if ( str_m == '' ) + return this.distance = str_n.length + else if ( str_n == '' ) + return this.distance = str_m.length + else { + // Danger Will Robinson + previous = [ 0 ] + forEach( str_m, function( v, i ) { i++, previous[ i ] = i } ) + + matrix[0] = previous + forEach( str_n, function( n_val, n_idx ) { + current = [ ++n_idx ] + forEach( str_m, function( m_val, m_idx ) { + m_idx++ + if ( getElem(str_m, m_idx - 1) == getElem(str_n, n_idx - 1) ) + current[ m_idx ] = previous[ m_idx - 1 ] + else + current[ m_idx ] = Math.min + ( previous[ m_idx ] + 1 // Deletion + , current[ m_idx - 1 ] + 1 // Insertion + , previous[ m_idx - 1 ] + 1 // Subtraction + ) + }) + previous = current + matrix[ matrix.length ] = previous + }) + + return this.distance = current[ current.length - 1 ] + } + } + + Levenshtein.prototype.toString = Levenshtein.prototype.inspect = function inspect ( no_print ) { var matrix, max, buff, sep, rows + matrix = this.getMatrix() + max = reduce( matrix,function( m, o ) { + return Math.max( m, reduce( o, Math.max, 0 ) ) + }, 0 ) + buff = Array( ( max + '' ).length ).join( ' ' ) + + sep = [] + while ( sep.length < (matrix[0] && matrix[0].length || 0) ) + sep[ sep.length ] = Array( buff.length + 1 ).join( '-' ) + sep = sep.join( '-+' ) + '-' + + rows = map( matrix, function( row ) { var cells + cells = map( row, function( cell ) { + return ( buff + cell ).slice( - buff.length ) + }) + return cells.join( ' |' ) + ' ' + }) + + return rows.join( "\n" + sep + "\n" ) + } + + // steps to get from string 1 to string 2 + Levenshtein.prototype.getSteps = function() { + var steps, matrix, x, y, u, l, d, min + steps = [] + matrix = this.getMatrix() + x = matrix.length - 1 + y = matrix[0].length - 1 + while(x !== 0 || y !== 0) { + u = y > 0 ? matrix[x][y-1] : Number.MAX_VALUE + l = x > 0 ? matrix[x-1][y] : Number.MAX_VALUE + d = y > 0 && x > 0 ? matrix[x-1][y-1] : Number.MAX_VALUE + min = Math.min(u, l, d) + if(min === d) { + if(d < matrix[x][y]) { + steps.push(['substitute', y, x]) + }// else steps.push(['no-op', y, x]) + x-- + y-- + } else if(min === l) { + steps.push(['insert', y, x]) + x-- + } else { + steps.push(['delete', y, x]) + y-- + } + } + return steps + } + + Levenshtein.prototype.getMatrix = function () { + return this._matrix.slice() + } + + Levenshtein.prototype.valueOf = function() { + return this.distance + } + + return Levenshtein + +})); + + + //This is the main plugin definition + $.fn.ghostHunter = function( options ) { + + //Here we use jQuery's extend to set default values if they weren't set by the user + var opts = $.extend( {}, $.fn.ghostHunter.defaults, options ); + if( opts.results ) + { + pluginMethods.init( this , opts ); + return pluginMethods; + } + }; + // If the Ghost instance is in a subpath of the site, set subpath + // as the path to the site with a leading slash and no trailing slash + // (i.e. "/path/to/instance"). + $.fn.ghostHunter.defaults = { + resultsData : false, + onPageLoad : false, + onKeyUp : false, + result_template : "

{{title}}

{{prettyPubDate}}

", + info_template : "

Number of posts found: {{amount}}

", + displaySearchInfo : true, + zeroResultsInfo : true, + before : false, + onComplete : false, + filterfields : false, + subpath : "", + item_preprocessor : false, + indexing_start : false, + indexing_end : false, + includebodysearch : false + }; + var prettyDate = function(date) { + var d = new Date(date); + var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + return d.getDate() + ' ' + monthNames[d.getMonth()] + ' ' + d.getFullYear(); + }; + + var getSubpathKey = function(str) { + return str.replace(/^\//, "").replace(/\//g, "-") + }; + + var lastTimeoutID = null; + + // We add a prefix to new IDs and remove it after a set of + // updates is complete, just in case a browser freaks over + // duplicate IDs in the DOM. + var settleIDs = function() { + $('.gh-search-item').each(function(){ + var oldAttr = this.getAttribute('id'); + var newAttr = oldAttr.replace(/^new-/, ""); + this.setAttribute('id', newAttr); + }); + }; + var updateSearchList = function(listItems, apiData, steps) { + for (var i=0,ilen=steps.length;i recordedDate) { + me.latestPost = arrayItem.updated_at; + } + var tag_arr = arrayItem.tags.map(function(v) { + return v.name; // `tag` object has an `name` property which is the value of tag. If you also want other info, check API and get that property + }) + if(arrayItem.meta_description == null) { arrayItem.meta_description = '' }; + var category = tag_arr.join(", "); + if (category.length < 1){ + category = "undefined"; + } + var parsedData = { + id : String(arrayItem.id), + title : String(arrayItem.title), + description : String(arrayItem.custom_excerpt), + pubDate : String(arrayItem.published_at), + tag : category + } + if ( me.includebodysearch ){ + parsedData.plaintext=String(arrayItem.plaintext); + } + this.add(parsedData) + var localUrl = me.subpath + arrayItem.url + me.blogData[arrayItem.id] = { + title: arrayItem.title, + description: arrayItem.custom_excerpt, + pubDate: prettyDate(parsedData.pubDate), + link: localUrl, + tags: tag_arr + }; + // If there is a metadata "pre"-processor for the item, run it here. + if (me.item_preprocessor) { + Object.assign(me.blogData[arrayItem.id], me.item_preprocessor(arrayItem)); + } + // console.log("done indexing the item"); + }, this); + }); + try { + var subpathKey = getSubpathKey(me.subpath); + localStorage.setItem(("ghost_" + subpathKey + "_lunrIndex"), JSON.stringify(me.index)); + localStorage.setItem(("ghost_" + subpathKey + "_blogData"), JSON.stringify(me.blogData)); + localStorage.setItem(("ghost_" + subpathKey + "_latestPost"), me.latestPost); + } catch (e) { + console.warn("ghostHunter: save to localStorage failed: " + e); + } + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + }); + } + + var pluginMethods = { + + isInit : false, + + init : function( target , opts ){ + var that = this; + that.target = target; + Object.assign(this, opts); + // console.log("ghostHunter: init"); + if ( opts.onPageLoad ) { + function miam () { + that.loadAPI(); + } + window.setTimeout(miam, 1); + } else { + target.focus(function(){ + that.loadAPI(); + }); + } + + target.closest("form").submit(function(e){ + e.preventDefault(); + that.find(target.val()); + }); + + if( opts.onKeyUp ) { + // In search-as-you-type mode, the Enter key is meaningless, + // so we disable it in the search field. If enabled, some browsers + // will save data to history (even when autocomplete="false"), which + // is an intrusive headache, particularly on mobile. + target.keydown(function(event){ + if (event.which === 13) { + return false; + } + }); + target.keyup(function(event) { + that.find(target.val()); + }); + + } + + }, + + loadAPI : function(){ + // console.log('ghostHunter: loadAPI'); + if(!this.isInit) { + // console.log('ghostHunter: this.isInit is true'); + if (this.indexing_start) { + this.indexing_start(); + } + // If isInit is falsy, check for data in localStore, + // parse into memory, and declare isInit to be true. + try { + var subpathKey = getSubpathKey(this.subpath); + this.index = localStorage.getItem(("ghost_" + subpathKey + "_lunrIndex")); + this.blogData = localStorage.getItem(("ghost_" + subpathKey + "_blogData")); + this.latestPost = localStorage.getItem(("ghost_" + subpathKey + "_latestPost")); + if (this.latestPost && this.index && this.blogData) { + this.latestPost = this.latestPost; + this.index = lunr.Index.load(JSON.parse(this.index)); + this.blogData = JSON.parse(this.blogData); + this.isInit = true; + } + } catch (e){ + console.warn("ghostHunter: retrieve from localStorage failed: " + e); + } + } + if (this.isInit) { + // console.log('ghostHunter: this.isInit recheck is true'); + // Check if there are new or edited posts + var params = { + limit: "all", + filter: "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'", + fields: "id" + }; + var ghost_root = ghost_root_url || "/ghost/api/v2"; + var url = ghost_root + "/content/posts/?key=" + ghosthunter_key + "&limit=all&fields=id" + "&filter=" + "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'"; + + var me = this; + $.get(url).done(function(data){ + if (data.posts.length > 0) { + grabAndIndex.call(me); + } else { + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + } + }); + } else { + // console.log('ghostHunter: this.isInit recheck is false'); + grabAndIndex.call(this) + } + }, + + + find : function(value){ + clearTimeout(lastTimeoutID); + if (!value) { + value = ""; + }; + value = value.toLowerCase(); + lastTimeoutID = setTimeout(function() { + // Query strategy is lifted from comments on a lunr.js issue: https://github.com/olivernn/lunr.js/issues/256 + var thingsFound = []; + // The query interface expects single terms, so we split. + var valueSplit = value.split(/\s+/); + for (var i=0,ilen=valueSplit.length;i 1) { + // If we had multiple terms, we'll have multiple lists. We filter + // them here to use only items that produce returns for all + // terms. This spoofs an AND join between terms, which lunr.js can't + // yet do internally. + // By using the first list of items as master, we get weightings + // based on the first term entered, which is more or less + // what we would expect. + var searchResult = thingsFound[0]; + thingsFound = thingsFound.slice(1); + for (var i=searchResult.length-1;i>-1;i--) { + var ref = searchResult[i].ref; + for (j=0,jlen=thingsFound.length;j 0) { + results.children().eq(0).replaceWith(this.format(this.info_template,{"amount":searchResult.length})); + } else { + results.append(this.format(this.info_template,{"amount":searchResult.length})); + } + } + + if(this.before) { + this.before(); + }; + + // Get the blogData for the full set, for onComplete + for (var i = 0; i < searchResult.length; i++) { + var lunrref = searchResult[i].ref; + var postData = this.blogData[lunrref]; + if (postData) { + postData.ref = lunrref; + resultsData.push(postData); + } else { + console.warn("ghostHunter: index/data mismatch. Ouch."); + } + } + // Get an array of IDs present in current results + var listItems = $('.gh-search-item'); + var currentRefs = listItems + .map(function(){ + return this.id.slice(3); + }).get(); + if (currentRefs.length === 0) { + for (var i=0,ilen=resultsData.length;i + + + + + + + + + ghostHunter + + + + + + +
+ + + +
+ +
+ +
+ + + + + + + + diff --git a/assets/bower_components/ghosthunter/example/rss.xml b/assets/bower_components/ghosthunter/example/rss.xml new file mode 100644 index 0000000000000..2a5c4407860a7 --- /dev/null +++ b/assets/bower_components/ghosthunter/example/rss.xml @@ -0,0 +1,4947 @@ + +<![CDATA[GateKeeper]]>http://127.0.0.1:2368/Ghost v0.4.0Sun, 26 Jan 2014 07:39:28 GMT60<![CDATA[Donec dapibus elit]]>featured

+ +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel orci non risus euismod rhoncus ac vel diam. Nam ut luctus massa, quis condimentum ligula. In pellentesque cursus lectus, in ultricies nisl scelerisque vestibulum. Ut at mi neque. Nullam in urna dui. Integer pharetra ornare massa et lacinia. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce aliquam eu nisl ut pellentesque. Pellentesque luctus neque adipiscing, porttitor leo sed, pellentesque sem. Maecenas tincidunt mollis metus, eget pulvinar sapien tristique sed.

+ +

Etiam ultricies aliquam neque. Integer ut porttitor sem. Ut semper at tortor eget lacinia. Maecenas quis pellentesque massa, quis tincidunt libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet mauris ac augue congue dictum vel id mauris. In sit amet molestie arcu, a scelerisque ligula. Duis pretium dolor quis ante tempus consequat. Suspendisse potenti. In semper magna eu nibh lobortis, eget tempor odio blandit. Fusce vitae eros vel elit suscipit fringilla.

+ +

Quisque tincidunt, nunc at congue tempus, erat arcu fringilla ligula, eu tristique augue est non tortor. Sed gravida erat ut dui egestas bibendum. Suspendisse ut ante consectetur, pellentesque arcu suscipit, faucibus urna. Curabitur ante lacus, rutrum nec orci id, interdum molestie neque. Sed mattis viverra sapien, a ultrices felis mollis in. Suspendisse ut volutpat elit, gravida accumsan sapien. Proin a varius elit. Duis eget odio ligula. Mauris eu odio nulla. Nulla ultrices, nunc eu viverra feugiat, enim turpis rutrum ligula, quis elementum orci lacus et eros. Donec lacus nulla, egestas eget sem sed, ullamcorper rhoncus leo. Curabitur id felis in mauris rhoncus vestibulum ac eget purus. Nam in felis quis lectus porta vulputate. Fusce nec luctus metus. Proin arcu nulla, sollicitudin vitae vestibulum sit amet, faucibus quis ligula.

+ +

Donec dapibus elit ac porta lobortis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Maecenas eu felis in augue porttitor aliquam a convallis leo. Sed sollicitudin arcu sed placerat tristique. Integer bibendum posuere iaculis. Duis ultrices risus et nunc varius lacinia. Aenean vel facilisis nunc. Mauris eleifend faucibus eleifend. Mauris consectetur eget justo ut semper. Suspendisse bibendum elementum ante ac dictum.

+ +

text

+ +

text

+ +

code

+ +

text

+ +

title +alt +* item +* item +* item +* item

+ +
+

quote

+
+ +

Heading

+ +

Heading

+ +

Heading

+ +

Heading

+ +
Heading
+ +
Heading
]]>
http://127.0.0.1:2368/donec-dapibus-elit/1c1b0112-f399-49cc-bd2c-eb1f6f9c33f0Thu, 23 Jan 2014 21:27:00 GMT
<![CDATA[Cum sociis natoque]]>featured +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam erat volutpat. Suspendisse libero ipsum, semper eget nunc in, porttitor aliquam ipsum. Maecenas sodales eros sed facilisis tincidunt. Aenean dapibus blandit tristique. Nunc tincidunt sollicitudin convallis. Phasellus consequat libero vel mi rhoncus, vel aliquet odio vulputate.

+ +

Fusce ac ante tempus, auctor enim a, porta erat. Integer pulvinar nunc ut nulla iaculis tincidunt. Duis pellentesque purus ac purus venenatis volutpat. Ut eu libero eu ipsum dapibus ullamcorper in congue lectus. Nunc suscipit aliquam turpis, a tristique ipsum ornare bibendum. Mauris iaculis lacus nisl, sed lacinia felis scelerisque nec. Proin pulvinar sed velit suscipit ullamcorper. Etiam in elit pellentesque, commodo nulla et, congue sem. Nulla fermentum metus ligula. Proin id massa dapibus, euismod urna eu, adipiscing augue. Nullam vel arcu a ipsum faucibus fringilla in tempus lacus.

+ +

In tincidunt, eros vel ornare sollicitudin, neque justo cursus felis, ac dictum diam nunc ut purus. Nulla dapibus lacinia ipsum et varius. Praesent viverra elit tellus, non fermentum tellus venenatis consectetur. Suspendisse at risus eu quam interdum rhoncus. Aenean eu dapibus nibh. Aliquam quis magna tempus risus iaculis congue. Vivamus fermentum, justo ut ultricies luctus, ante tellus imperdiet erat, et lacinia felis velit nec mi. Phasellus tempor elit sed adipiscing tempor. Vestibulum dapibus felis nec neque tincidunt, a pellentesque erat ullamcorper. Sed facilisis massa eu mauris euismod tincidunt eget ac velit.

]]>
http://127.0.0.1:2368/cum-sociis-natoque/8cb68934-d0df-46d2-baf3-b0def62dedc1Thu, 23 Jan 2014 21:26:07 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Welcome to Ghost]]>featured +You're in! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. Go ahead and edit this post to get going and learn how it all works!

+ +

Getting Started

+ +

Writing in markdown is really easy. In the left hand panel of Ghost, you simply write as you normally would. Where appropriate, you can use formatting shortcuts to style your content. For example, a list:

+ +
    +
  • Item number one
  • +
  • Item number two +
    • A nested item
  • +
  • A final item
  • +
+ +

or with numbers!

+ +
    +
  1. Remember to buy some milk
  2. +
  3. Drink the milk
  4. +
  5. Tweet that I remembered to buy the milk, and drank it
  6. +
+ + + +

Want to link to a source? No problem. If you paste in url, like http://ghost.org - it'll automatically be linked up. But if you want to customise your anchor text, you can do that too! Here's a link to the Ghost website. Neat.

+ +

What about Images?

+ +

Images work too! Already know the URL of the image you want to include in your article? Simply paste it in like this to make it show up:

+ +

The Ghost Logo

+ +

Not sure which image you want to use yet? That's ok too. Leave yourself a descriptive placeholder and keep writing. Come back later and drag and drop the image in to upload:

+ +

A bowl of bananas

+ +

Quoting

+ +

Sometimes a link isn't enough, you want to quote someone on what they've said. It was probably very wisdomous. Is wisdomous a word? Find out in a future release when we introduce spellcheck! For now - it's definitely a word.

+ +
+

Wisdomous - it's definitely a word.

+
+ +

Working with Code

+ +

Got a streak of geek? We've got you covered there, too. You can write inline <code> blocks really easily with back ticks. Want to show off something more comprehensive? 4 spaces of indentation gets you there.

+ +
.awesome-thing {
+    display: block;
+    width: 100%;
+}
+
+ +

Ready for a Break?

+ +

Throw 3 or more dashes down on any new line and you've got yourself a fancy new divider. Aw yeah.

+ +
+ +

Advanced Usage

+ +

There's one fantastic secret about Markdown. If you want, you can write plain old HTML and it'll still work! Very flexible.

+ +

+ +

That should be enough to get you started. Have fun - and let us know what you think :)

]]>
http://127.0.0.1:2368/welcome-to-ghost-2/7d07aeac-e8c8-48d0-96e1-8c4c4977704dThu, 23 Jan 2014 21:24:59 GMT
<![CDATA[Fusce ac ante tempus]]>featured +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam erat volutpat. Suspendisse libero ipsum, semper eget nunc in, porttitor aliquam ipsum. Maecenas sodales eros sed facilisis tincidunt. Aenean dapibus blandit tristique. Nunc tincidunt sollicitudin convallis. Phasellus consequat libero vel mi rhoncus, vel aliquet odio vulputate.

+ + + +

Fusce ac ante tempus, auctor enim a, porta erat. Integer pulvinar nunc ut nulla iaculis tincidunt. Duis pellentesque purus ac purus venenatis volutpat. Ut eu libero eu ipsum dapibus ullamcorper in congue lectus. Nunc suscipit aliquam turpis, a tristique ipsum ornare bibendum. Mauris iaculis lacus nisl, sed lacinia felis scelerisque nec. Proin pulvinar sed velit suscipit ullamcorper. Etiam in elit pellentesque, commodo nulla et, congue sem. Nulla fermentum metus ligula. Proin id massa dapibus, euismod urna eu, adipiscing augue. Nullam vel arcu a ipsum faucibus fringilla in tempus lacus.

+ +

In tincidunt, eros vel ornare sollicitudin, neque justo cursus felis, ac dictum diam nunc ut purus. Nulla dapibus lacinia ipsum et varius. Praesent viverra elit tellus, non fermentum tellus venenatis consectetur. Suspendisse at risus eu quam interdum rhoncus. Aenean eu dapibus nibh. Aliquam quis magna tempus risus iaculis congue. Vivamus fermentum, justo ut ultricies luctus, ante tellus imperdiet erat, et lacinia felis velit nec mi. Phasellus tempor elit sed adipiscing tempor. Vestibulum dapibus felis nec neque tincidunt, a pellentesque erat ullamcorper. Sed facilisis massa eu mauris euismod tincidunt eget ac velit.

]]>
http://127.0.0.1:2368/fusce-ac-ante-tempus/d46d0f69-7b3e-4896-b9de-0235fd040c75Thu, 23 Jan 2014 21:22:31 GMT
<![CDATA[In tincidunt, eros]]>featured +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam erat volutpat. Suspendisse libero ipsum, semper eget nunc in, porttitor aliquam ipsum. Maecenas sodales eros sed facilisis tincidunt. Aenean dapibus blandit tristique. Nunc tincidunt sollicitudin convallis. Phasellus consequat libero vel mi rhoncus, vel aliquet odio vulputate.

+ +

Fusce ac ante tempus, auctor enim a, porta erat. Integer pulvinar nunc ut nulla iaculis tincidunt. Duis pellentesque purus ac purus venenatis volutpat. Ut eu libero eu ipsum dapibus ullamcorper in congue lectus. Nunc suscipit aliquam turpis, a tristique ipsum ornare bibendum. Mauris iaculis lacus nisl, sed lacinia felis scelerisque nec. Proin pulvinar sed velit suscipit ullamcorper. Etiam in elit pellentesque, commodo nulla et, congue sem. Nulla fermentum metus ligula. Proin id massa dapibus, euismod urna eu, adipiscing augue. Nullam vel arcu a ipsum faucibus fringilla in tempus lacus.

+ +

In tincidunt, eros vel ornare sollicitudin, neque justo cursus felis, ac dictum diam nunc ut purus. Nulla dapibus lacinia ipsum et varius. Praesent viverra elit tellus, non fermentum tellus venenatis consectetur. Suspendisse at risus eu quam interdum rhoncus. Aenean eu dapibus nibh. Aliquam quis magna tempus risus iaculis congue. Vivamus fermentum, justo ut ultricies luctus, ante tellus imperdiet erat, et lacinia felis velit nec mi. Phasellus tempor elit sed adipiscing tempor. Vestibulum dapibus felis nec neque tincidunt, a pellentesque erat ullamcorper. Sed facilisis massa eu mauris euismod tincidunt eget ac velit.

]]>
http://127.0.0.1:2368/in-tincidunt-eros/aead9199-603e-4f44-abcd-87b3bebdcd0aThu, 23 Jan 2014 21:21:17 GMT
<![CDATA[Welcome to Ghost]]>featured +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam erat volutpat. Suspendisse libero ipsum, semper eget nunc in, porttitor aliquam ipsum. Maecenas sodales eros sed facilisis tincidunt. Aenean dapibus blandit tristique. Nunc tincidunt sollicitudin convallis. Phasellus consequat libero vel mi rhoncus, vel aliquet odio vulputate.

+ +

Fusce ac ante tempus, auctor enim a, porta erat. Integer pulvinar nunc ut nulla iaculis tincidunt. Duis pellentesque purus ac purus venenatis volutpat. Ut eu libero eu ipsum dapibus ullamcorper in congue lectus. Nunc suscipit aliquam turpis, a tristique ipsum ornare bibendum. Mauris iaculis lacus nisl, sed lacinia felis scelerisque nec. Proin pulvinar sed velit suscipit ullamcorper. Etiam in elit pellentesque, commodo nulla et, congue sem. Nulla fermentum metus ligula. Proin id massa dapibus, euismod urna eu, adipiscing augue. Nullam vel arcu a ipsum faucibus fringilla in tempus lacus.

+ +

In tincidunt, eros vel ornare sollicitudin, neque justo cursus felis, ac dictum diam nunc ut purus. Nulla dapibus lacinia ipsum et varius. Praesent viverra elit tellus, non fermentum tellus venenatis consectetur. Suspendisse at risus eu quam interdum rhoncus. Aenean eu dapibus nibh. Aliquam quis magna tempus risus iaculis congue. Vivamus fermentum, justo ut ultricies luctus, ante tellus imperdiet erat, et lacinia felis velit nec mi. Phasellus tempor elit sed adipiscing tempor. Vestibulum dapibus felis nec neque tincidunt, a pellentesque erat ullamcorper. Sed facilisis massa eu mauris euismod tincidunt eget ac velit.

]]>
http://127.0.0.1:2368/welcome-to-ghost/c44077e2-e39e-45ac-8dde-490dd0517ffaMon, 13 Jan 2014 14:47:12 GMT
\ No newline at end of file diff --git a/assets/bower_components/ghosthunter/package-lock.json b/assets/bower_components/ghosthunter/package-lock.json new file mode 100644 index 0000000000000..cc476ab69c371 --- /dev/null +++ b/assets/bower_components/ghosthunter/package-lock.json @@ -0,0 +1,895 @@ +{ + "name": "ghosthunter", + "version": "0.6.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + }, + "dependencies": { + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + } + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "coffeescript": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz", + "integrity": "sha1-56qDAZF+9iGzXYo580jc3R234z4=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "meow": "^3.3.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "file-sync-cmp": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", + "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "dev": true, + "requires": { + "glob": "~5.0.0" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getobject": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", + "dev": true + }, + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "grunt": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.4.tgz", + "integrity": "sha512-PYsMOrOC+MsdGEkFVwMaMyc6Ob7pKmq+deg1Sjr+vvMWp35sztfwKE7qoN51V+UEtHsyNuMcGdgMLFkBHvMxHQ==", + "dev": true, + "requires": { + "coffeescript": "~1.10.0", + "dateformat": "~1.0.12", + "eventemitter2": "~0.4.13", + "exit": "~0.1.1", + "findup-sync": "~0.3.0", + "glob": "~7.0.0", + "grunt-cli": "~1.2.0", + "grunt-known-options": "~1.1.0", + "grunt-legacy-log": "~2.0.0", + "grunt-legacy-util": "~1.1.1", + "iconv-lite": "~0.4.13", + "js-yaml": "~3.13.0", + "minimatch": "~3.0.2", + "mkdirp": "~0.5.1", + "nopt": "~3.0.6", + "path-is-absolute": "~1.0.0", + "rimraf": "~2.6.2" + }, + "dependencies": { + "grunt-cli": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "dev": true, + "requires": { + "findup-sync": "~0.3.0", + "grunt-known-options": "~1.1.0", + "nopt": "~3.0.6", + "resolve": "~1.1.0" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "grunt-contrib-copy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", + "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "file-sync-cmp": "^0.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "grunt-known-options": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", + "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", + "dev": true + }, + "grunt-legacy-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", + "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", + "dev": true, + "requires": { + "colors": "~1.1.2", + "grunt-legacy-log-utils": "~2.0.0", + "hooker": "~0.2.3", + "lodash": "~4.17.5" + } + }, + "grunt-legacy-log-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", + "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", + "dev": true, + "requires": { + "chalk": "~2.4.1", + "lodash": "~4.17.10" + } + }, + "grunt-legacy-util": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", + "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", + "dev": true, + "requires": { + "async": "~1.5.2", + "exit": "~0.1.1", + "getobject": "~0.1.0", + "hooker": "~0.2.3", + "lodash": "~4.17.10", + "underscore.string": "~3.3.4", + "which": "~1.3.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "dev": true + }, + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "underscore.string": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", + "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "dev": true, + "requires": { + "sprintf-js": "^1.0.3", + "util-deprecate": "^1.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/assets/bower_components/ghosthunter/package.json b/assets/bower_components/ghosthunter/package.json new file mode 100644 index 0000000000000..0a7505aec3e29 --- /dev/null +++ b/assets/bower_components/ghosthunter/package.json @@ -0,0 +1,27 @@ +{ + "name": "ghosthunter", + "version": "0.6.0", + "description": "GhostHunter allows a theme developer for the Ghost blogging platform to add client-side search capability using lunr.js.", + "main": "jquery.ghostHunter.js", + "directories": { + "example": "example" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/fbennett/ghostHunter.git" + }, + "author": "Jamal Neufeld", + "license": "MIT", + "bugs": { + "url": "https://github.com/fbennett/ghostHunter/issues" + }, + "homepage": "https://github.com/fbennett/ghostHunter#readme", + "dependencies": {}, + "devDependencies": { + "grunt": "^1.0.1", + "grunt-contrib-copy": "^1.0.0" + } +} diff --git a/assets/bower_components/ghosthunter/src/ghosthunter-nodependency.js b/assets/bower_components/ghosthunter/src/ghosthunter-nodependency.js new file mode 100644 index 0000000000000..34ccfbc7a2524 --- /dev/null +++ b/assets/bower_components/ghosthunter/src/ghosthunter-nodependency.js @@ -0,0 +1,419 @@ +/** +* ghostHunter - 0.6.0 + * Copyright (C) 2014 Jamal Neufeld (jamal@i11u.me) + * MIT Licensed + * @license +*/ +(function( $ ) { + + /* Include the Lunr library */ + var lunr=require('./lunr.min.js'); + + /* LEVENSHTEIN */ + + //This is the main plugin definition + $.fn.ghostHunter = function( options ) { + + //Here we use jQuery's extend to set default values if they weren't set by the user + var opts = $.extend( {}, $.fn.ghostHunter.defaults, options ); + if( opts.results ) + { + pluginMethods.init( this , opts ); + return pluginMethods; + } + }; + // If the Ghost instance is in a subpath of the site, set subpath + // as the path to the site with a leading slash and no trailing slash + // (i.e. "/path/to/instance"). + $.fn.ghostHunter.defaults = { + resultsData : false, + onPageLoad : false, + onKeyUp : false, + result_template : "

{{title}}

{{prettyPubDate}}

", + info_template : "

Number of posts found: {{amount}}

", + displaySearchInfo : true, + zeroResultsInfo : true, + before : false, + onComplete : false, + filterfields : false, + subpath : "", + item_preprocessor : false, + indexing_start : false, + indexing_end : false, + includebodysearch : false + }; + var prettyDate = function(date) { + var d = new Date(date); + var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + return d.getDate() + ' ' + monthNames[d.getMonth()] + ' ' + d.getFullYear(); + }; + + var getSubpathKey = function(str) { + return str.replace(/^\//, "").replace(/\//g, "-") + }; + + var lastTimeoutID = null; + + // We add a prefix to new IDs and remove it after a set of + // updates is complete, just in case a browser freaks over + // duplicate IDs in the DOM. + var settleIDs = function() { + $('.gh-search-item').each(function(){ + var oldAttr = this.getAttribute('id'); + var newAttr = oldAttr.replace(/^new-/, ""); + this.setAttribute('id', newAttr); + }); + }; + + var updateSearchList = function(listItems, apiData, steps) { + for (var i=0,ilen=steps.length;i recordedDate) { + me.latestPost = arrayItem.updated_at; + } + var tag_arr = arrayItem.tags.map(function(v) { + return v.name; // `tag` object has an `name` property which is the value of tag. If you also want other info, check API and get that property + }) + if(arrayItem.meta_description == null) { arrayItem.meta_description = '' }; + var category = tag_arr.join(", "); + if (category.length < 1){ + category = "undefined"; + } + var parsedData = { + id : String(arrayItem.id), + title : String(arrayItem.title), + description : String(arrayItem.custom_excerpt), + pubDate : String(arrayItem.published_at), + tag : category + } + if ( me.includebodysearch ){ + parsedData.plaintext=String(arrayItem.plaintext); + } + this.add(parsedData) + var localUrl = me.subpath + arrayItem.url + me.blogData[arrayItem.id] = { + title: arrayItem.title, + description: arrayItem.custom_excerpt, + pubDate: prettyDate(parsedData.pubDate), + link: localUrl, + tags: tag_arr + }; + // If there is a metadata "pre"-processor for the item, run it here. + if (me.item_preprocessor) { + Object.assign(me.blogData[arrayItem.id], me.item_preprocessor(arrayItem)); + } + // console.log("done indexing the item"); + }, this); + }); + try { + var subpathKey = getSubpathKey(me.subpath); + localStorage.setItem(("ghost_" + subpathKey + "_lunrIndex"), JSON.stringify(me.index)); + localStorage.setItem(("ghost_" + subpathKey + "_blogData"), JSON.stringify(me.blogData)); + localStorage.setItem(("ghost_" + subpathKey + "_latestPost"), me.latestPost); + } catch (e) { + console.warn("ghostHunter: save to localStorage failed: " + e); + } + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + }); + } + + var pluginMethods = { + + isInit : false, + + init : function( target , opts ){ + var that = this; + that.target = target; + Object.assign(this, opts); + console.log("ghostHunter: init"); + if ( opts.onPageLoad ) { + function miam () { + that.loadAPI(); + } + window.setTimeout(miam, 1); + } else { + target.focus(function(){ + that.loadAPI(); + }); + } + + target.closest("form").submit(function(e){ + e.preventDefault(); + that.find(target.val()); + }); + + if( opts.onKeyUp ) { + // In search-as-you-type mode, the Enter key is meaningless, + // so we disable it in the search field. If enabled, some browsers + // will save data to history (even when autocomplete="false"), which + // is an intrusive headache, particularly on mobile. + target.keydown(function(event){ + if (event.which === 13) { + return false; + } + }); + target.keyup(function(event) { + that.find(target.val()); + }); + + } + + }, + + loadAPI : function(){ + // console.log('ghostHunter: loadAPI'); + if(!this.isInit) { + // console.log('ghostHunter: this.isInit is true'); + if (this.indexing_start) { + this.indexing_start(); + } + // If isInit is falsy, check for data in localStore, + // parse into memory, and declare isInit to be true. + try { + var subpathKey = getSubpathKey(this.subpath); + this.index = localStorage.getItem(("ghost_" + subpathKey + "_lunrIndex")); + this.blogData = localStorage.getItem(("ghost_" + subpathKey + "_blogData")); + this.latestPost = localStorage.getItem(("ghost_" + subpathKey + "_latestPost")); + if (this.latestPost && this.index && this.blogData) { + this.latestPost = this.latestPost; + this.index = lunr.Index.load(JSON.parse(this.index)); + this.blogData = JSON.parse(this.blogData); + this.isInit = true; + } + } catch (e){ + console.warn("ghostHunter: retrieve from localStorage failed: " + e); + } + } + if (this.isInit) { + // console.log('ghostHunter: this.isInit recheck is true'); + // Check if there are new or edited posts + var params = { + limit: "all", + filter: "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'", + fields: "id" + }; + + var url = "/ghost/api/v2/content/posts/?key=" + + ghosthunter_key + "&limit=all&fields=id" + "&filter=" + + "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") "\'"; + + var me = this; + $.get(url).done(function(data){ + if (data.posts.length > 0) { + grabAndIndex.call(me); + } else { + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + } + }); + } else { + // console.log('ghostHunter: this.isInit recheck is false'); + grabAndIndex.call(this) + } + }, + + + find : function(value){ + clearTimeout(lastTimeoutID); + if (!value) { + value = ""; + }; + value = value.toLowerCase(); + lastTimeoutID = setTimeout(function() { + // Query strategy is lifted from comments on a lunr.js issue: https://github.com/olivernn/lunr.js/issues/256 + var thingsFound = []; + // The query interface expects single terms, so we split. + var valueSplit = value.split(/\s+/); + for (var i=0,ilen=valueSplit.length;i 1) { + // If we had multiple terms, we'll have multiple lists. We filter + // them here to use only items that produce returns for all + // terms. This spoofs an AND join between terms, which lunr.js can't + // yet do internally. + // By using the first list of items as master, we get weightings + // based on the first term entered, which is more or less + // what we would expect. + var searchResult = thingsFound[0]; + thingsFound = thingsFound.slice(1); + for (var i=searchResult.length-1;i>-1;i--) { + var ref = searchResult[i].ref; + for (j=0,jlen=thingsFound.length;j 0) { + results.children().eq(0).replaceWith(this.format(this.info_template,{"amount":searchResult.length})); + } else { + results.append(this.format(this.info_template,{"amount":searchResult.length})); + } + } + + if(this.before) { + this.before(); + }; + + // Get the blogData for the full set, for onComplete + for (var i = 0; i < searchResult.length; i++) { + var lunrref = searchResult[i].ref; + var postData = this.blogData[lunrref]; + if (postData) { + postData.ref = lunrref; + resultsData.push(postData); + } else { + console.warn("ghostHunter: index/data mismatch. Ouch."); + } + } + // Get an array of IDs present in current results + var listItems = $('.gh-search-item'); + var currentRefs = listItems + .map(function(){ + return this.id.slice(3); + }).get(); + if (currentRefs.length === 0) { + for (var i=0,ilen=resultsData.length;i

{{title}}

{{pubDate}}

", + info_template : "

Number of posts found: {{amount}}

", + displaySearchInfo : true, + zeroResultsInfo : true, + before : false, + onComplete : false, + filterfields : false, + subpath : "", + item_preprocessor : false, + indexing_start : false, + indexing_end : false, + includebodysearch : false + }; + var prettyDate = function(date) { + var d = new Date(date); + var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + return d.getDate() + ' ' + monthNames[d.getMonth()] + ' ' + d.getFullYear(); + }; + + var getSubpathKey = function(str) { + return str.replace(/^\//, "").replace(/\//g, "-") + }; + + var lastTimeoutID = null; + + // We add a prefix to new IDs and remove it after a set of + // updates is complete, just in case a browser freaks over + // duplicate IDs in the DOM. + var settleIDs = function() { + $('.gh-search-item').each(function(){ + var oldAttr = this.getAttribute('id'); + var newAttr = oldAttr.replace(/^new-/, ""); + this.setAttribute('id', newAttr); + }); + }; + var updateSearchList = function(listItems, apiData, steps) { + for (var i=0,ilen=steps.length;i recordedDate) { + me.latestPost = arrayItem.updated_at; + } + var tag_arr = arrayItem.tags.map(function(v) { + return v.name; // `tag` object has an `name` property which is the value of tag. If you also want other info, check API and get that property + }) + if(arrayItem.meta_description == null) { arrayItem.meta_description = '' }; + var category = tag_arr.join(", "); + if (category.length < 1){ + category = "undefined"; + } + var parsedData = { + id : String(arrayItem.id), + title : String(arrayItem.title), + description : String(arrayItem.custom_excerpt), + pubDate : String(arrayItem.published_at), + tag : category + } + if ( me.includebodysearch ){ + parsedData.plaintext=String(arrayItem.plaintext); + } + this.add(parsedData) + var localUrl = me.subpath + arrayItem.url + me.blogData[arrayItem.id] = { + title: arrayItem.title, + description: arrayItem.custom_excerpt, + pubDate: prettyDate(parsedData.pubDate), + link: localUrl, + tags: tag_arr + }; + // If there is a metadata "pre"-processor for the item, run it here. + if (me.item_preprocessor) { + Object.assign(me.blogData[arrayItem.id], me.item_preprocessor(arrayItem)); + } + // console.log("done indexing the item"); + }, this); + }); + try { + var subpathKey = getSubpathKey(me.subpath); + localStorage.setItem(("ghost_" + subpathKey + "_lunrIndex"), JSON.stringify(me.index)); + localStorage.setItem(("ghost_" + subpathKey + "_blogData"), JSON.stringify(me.blogData)); + localStorage.setItem(("ghost_" + subpathKey + "_latestPost"), me.latestPost); + } catch (e) { + console.warn("ghostHunter: save to localStorage failed: " + e); + } + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + }); + } + + var pluginMethods = { + + isInit : false, + + init : function( target , opts ){ + var that = this; + that.target = target; + Object.assign(this, opts); + // console.log("ghostHunter: init"); + if ( opts.onPageLoad ) { + function miam () { + that.loadAPI(); + } + window.setTimeout(miam, 1); + } else { + target.focus(function(){ + that.loadAPI(); + }); + } + + target.closest("form").submit(function(e){ + e.preventDefault(); + that.find(target.val()); + }); + + if( opts.onKeyUp ) { + // In search-as-you-type mode, the Enter key is meaningless, + // so we disable it in the search field. If enabled, some browsers + // will save data to history (even when autocomplete="false"), which + // is an intrusive headache, particularly on mobile. + target.keydown(function(event){ + if (event.which === 13) { + return false; + } + }); + target.keyup(function(event) { + that.find(target.val()); + }); + + } + + }, + + loadAPI : function(){ + // console.log('ghostHunter: loadAPI'); + if(!this.isInit) { + // console.log('ghostHunter: this.isInit is true'); + if (this.indexing_start) { + this.indexing_start(); + } + // If isInit is falsy, check for data in localStore, + // parse into memory, and declare isInit to be true. + try { + var subpathKey = getSubpathKey(this.subpath); + this.index = localStorage.getItem(("ghost_" + subpathKey + "_lunrIndex")); + this.blogData = localStorage.getItem(("ghost_" + subpathKey + "_blogData")); + this.latestPost = localStorage.getItem(("ghost_" + subpathKey + "_latestPost")); + if (this.latestPost && this.index && this.blogData) { + this.latestPost = this.latestPost; + this.index = lunr.Index.load(JSON.parse(this.index)); + this.blogData = JSON.parse(this.blogData); + this.isInit = true; + } + } catch (e){ + console.warn("ghostHunter: retrieve from localStorage failed: " + e); + } + } + if (this.isInit) { + // console.log('ghostHunter: this.isInit recheck is true'); + // Check if there are new or edited posts + var params = { + limit: "all", + filter: "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'", + fields: "id" + }; + + var url = "/ghost/api/v2/content/posts/?key=" + ghosthunter_key + "&limit=all&fields=id" + "&filter=" + "updated_at:>\'" + this.latestPost.replace(/\..*/, "").replace(/T/, " ") + "\'"; + + var me = this; + $.get(url).done(function(data){ + if (data.posts.length > 0) { + grabAndIndex.call(me); + } else { + if (me.indexing_end) { + me.indexing_end(); + } + me.isInit = true; + } + }); + } else { + // console.log('ghostHunter: this.isInit recheck is false'); + grabAndIndex.call(this) + } + }, + + + find : function(value){ + clearTimeout(lastTimeoutID); + if (!value) { + value = ""; + }; + value = value.toLowerCase(); + lastTimeoutID = setTimeout(function() { + // Query strategy is lifted from comments on a lunr.js issue: https://github.com/olivernn/lunr.js/issues/256 + var thingsFound = []; + // The query interface expects single terms, so we split. + var valueSplit = value.split(/\s+/); + for (var i=0,ilen=valueSplit.length;i 1) { + // If we had multiple terms, we'll have multiple lists. We filter + // them here to use only items that produce returns for all + // terms. This spoofs an AND join between terms, which lunr.js can't + // yet do internally. + // By using the first list of items as master, we get weightings + // based on the first term entered, which is more or less + // what we would expect. + var searchResult = thingsFound[0]; + thingsFound = thingsFound.slice(1); + for (var i=searchResult.length-1;i>-1;i--) { + var ref = searchResult[i].ref; + for (j=0,jlen=thingsFound.length;j 0) { + results.children().eq(0).replaceWith(this.format(this.info_template,{"amount":searchResult.length})); + } else { + results.append(this.format(this.info_template,{"amount":searchResult.length})); + } + } + + if(this.before) { + this.before(); + }; + + // Get the blogData for the full set, for onComplete + for (var i = 0; i < searchResult.length; i++) { + var lunrref = searchResult[i].ref; + var postData = this.blogData[lunrref]; + if (postData) { + postData.ref = lunrref; + resultsData.push(postData); + } else { + console.warn("ghostHunter: index/data mismatch. Ouch."); + } + } + // Get an array of IDs present in current results + var listItems = $('.gh-search-item'); + var currentRefs = listItems + .map(function(){ + return this.id.slice(3); + }).get(); + if (currentRefs.length === 0) { + for (var i=0,ilen=resultsData.length;i 0 ? matrix[x][y-1] : Number.MAX_VALUE + l = x > 0 ? matrix[x-1][y] : Number.MAX_VALUE + d = y > 0 && x > 0 ? matrix[x-1][y-1] : Number.MAX_VALUE + min = Math.min(u, l, d) + if(min === d) { + if(d < matrix[x][y]) { + steps.push(['substitute', y, x]) + }// else steps.push(['no-op', y, x]) + x-- + y-- + } else if(min === l) { + steps.push(['insert', y, x]) + x-- + } else { + steps.push(['delete', y, x]) + y-- + } + } + return steps + } + + Levenshtein.prototype.getMatrix = function () { + return this._matrix.slice() + } + + Levenshtein.prototype.valueOf = function() { + return this.distance + } + + return Levenshtein + +})); diff --git a/assets/bower_components/ghosthunter/src/lunr.js b/assets/bower_components/ghosthunter/src/lunr.js new file mode 100644 index 0000000000000..92ee9f2e79879 --- /dev/null +++ b/assets/bower_components/ghosthunter/src/lunr.js @@ -0,0 +1,2982 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.1.5 + * Copyright (C) 2017 Oliver Nightingale + * @license MIT + */ + +;(function(){ + +/** + * A convenience function for configuring and constructing + * a new lunr Index. + * + * A lunr.Builder instance is created and the pipeline setup + * with a trimmer, stop word filter and stemmer. + * + * This builder object is yielded to the configuration function + * that is passed as a parameter, allowing the list of fields + * and other builder parameters to be customised. + * + * All documents _must_ be added within the passed config function. + * + * @example + * var idx = lunr(function () { + * this.field('title') + * this.field('body') + * this.ref('id') + * + * documents.forEach(function (doc) { + * this.add(doc) + * }, this) + * }) + * + * @see {@link lunr.Builder} + * @see {@link lunr.Pipeline} + * @see {@link lunr.trimmer} + * @see {@link lunr.stopWordFilter} + * @see {@link lunr.stemmer} + * @namespace {function} lunr + */ +var lunr = function (config) { + var builder = new lunr.Builder + + builder.pipeline.add( + lunr.trimmer, + lunr.stopWordFilter, + lunr.stemmer + ) + + builder.searchPipeline.add( + lunr.stemmer + ) + + config.call(builder, builder) + return builder.build() +} + +lunr.version = "2.1.5" +/*! + * lunr.utils + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * A namespace containing utils for the rest of the lunr library + */ +lunr.utils = {} + +/** + * Print a warning message to the console. + * + * @param {String} message The message to be printed. + * @memberOf Utils + */ +lunr.utils.warn = (function (global) { + /* eslint-disable no-console */ + return function (message) { + if (global.console && console.warn) { + console.warn(message) + } + } + /* eslint-enable no-console */ +})(this) + +/** + * Convert an object to a string. + * + * In the case of `null` and `undefined` the function returns + * the empty string, in all other cases the result of calling + * `toString` on the passed object is returned. + * + * @param {Any} obj The object to convert to a string. + * @return {String} string representation of the passed object. + * @memberOf Utils + */ +lunr.utils.asString = function (obj) { + if (obj === void 0 || obj === null) { + return "" + } else { + return obj.toString() + } +} +lunr.FieldRef = function (docRef, fieldName, stringValue) { + this.docRef = docRef + this.fieldName = fieldName + this._stringValue = stringValue +} + +lunr.FieldRef.joiner = "/" + +lunr.FieldRef.fromString = function (s) { + var n = s.indexOf(lunr.FieldRef.joiner) + + if (n === -1) { + throw "malformed field ref string" + } + + var fieldRef = s.slice(0, n), + docRef = s.slice(n + 1) + + return new lunr.FieldRef (docRef, fieldRef, s) +} + +lunr.FieldRef.prototype.toString = function () { + if (this._stringValue == undefined) { + this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef + } + + return this._stringValue +} +/** + * A function to calculate the inverse document frequency for + * a posting. This is shared between the builder and the index + * + * @private + * @param {object} posting - The posting for a given term + * @param {number} documentCount - The total number of documents. + */ +lunr.idf = function (posting, documentCount) { + var documentsWithTerm = 0 + + for (var fieldName in posting) { + if (fieldName == '_index') continue // Ignore the term index, its not a field + documentsWithTerm += Object.keys(posting[fieldName]).length + } + + var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5) + + return Math.log(1 + Math.abs(x)) +} + +/** + * A token wraps a string representation of a token + * as it is passed through the text processing pipeline. + * + * @constructor + * @param {string} [str=''] - The string token being wrapped. + * @param {object} [metadata={}] - Metadata associated with this token. + */ +lunr.Token = function (str, metadata) { + this.str = str || "" + this.metadata = metadata || {} +} + +/** + * Returns the token string that is being wrapped by this object. + * + * @returns {string} + */ +lunr.Token.prototype.toString = function () { + return this.str +} + +/** + * A token update function is used when updating or optionally + * when cloning a token. + * + * @callback lunr.Token~updateFunction + * @param {string} str - The string representation of the token. + * @param {Object} metadata - All metadata associated with this token. + */ + +/** + * Applies the given function to the wrapped string token. + * + * @example + * token.update(function (str, metadata) { + * return str.toUpperCase() + * }) + * + * @param {lunr.Token~updateFunction} fn - A function to apply to the token string. + * @returns {lunr.Token} + */ +lunr.Token.prototype.update = function (fn) { + this.str = fn(this.str, this.metadata) + return this +} + +/** + * Creates a clone of this token. Optionally a function can be + * applied to the cloned token. + * + * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token. + * @returns {lunr.Token} + */ +lunr.Token.prototype.clone = function (fn) { + fn = fn || function (s) { return s } + return new lunr.Token (fn(this.str, this.metadata), this.metadata) +} +/*! + * lunr.tokenizer + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * A function for splitting a string into tokens ready to be inserted into + * the search index. Uses `lunr.tokenizer.separator` to split strings, change + * the value of this property to change how strings are split into tokens. + * + * This tokenizer will convert its parameter to a string by calling `toString` and + * then will split this string on the character in `lunr.tokenizer.separator`. + * Arrays will have their elements converted to strings and wrapped in a lunr.Token. + * + * @static + * @param {?(string|object|object[])} obj - The object to convert into tokens + * @returns {lunr.Token[]} + */ +lunr.tokenizer = function (obj) { + if (obj == null || obj == undefined) { + return [] + } + + if (Array.isArray(obj)) { + return obj.map(function (t) { + return new lunr.Token(lunr.utils.asString(t).toLowerCase()) + }) + } + + var str = obj.toString().trim().toLowerCase(), + len = str.length, + tokens = [] + + for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) { + var char = str.charAt(sliceEnd), + sliceLength = sliceEnd - sliceStart + + if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) { + + if (sliceLength > 0) { + tokens.push( + new lunr.Token (str.slice(sliceStart, sliceEnd), { + position: [sliceStart, sliceLength], + index: tokens.length + }) + ) + } + + sliceStart = sliceEnd + 1 + } + + } + + return tokens +} + +/** + * The separator used to split a string into tokens. Override this property to change the behaviour of + * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens. + * + * @static + * @see lunr.tokenizer + */ +lunr.tokenizer.separator = /[\s\-]+/ +/*! + * lunr.Pipeline + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.Pipelines maintain an ordered list of functions to be applied to all + * tokens in documents entering the search index and queries being ran against + * the index. + * + * An instance of lunr.Index created with the lunr shortcut will contain a + * pipeline with a stop word filter and an English language stemmer. Extra + * functions can be added before or after either of these functions or these + * default functions can be removed. + * + * When run the pipeline will call each function in turn, passing a token, the + * index of that token in the original list of all tokens and finally a list of + * all the original tokens. + * + * The output of functions in the pipeline will be passed to the next function + * in the pipeline. To exclude a token from entering the index the function + * should return undefined, the rest of the pipeline will not be called with + * this token. + * + * For serialisation of pipelines to work, all functions used in an instance of + * a pipeline should be registered with lunr.Pipeline. Registered functions can + * then be loaded. If trying to load a serialised pipeline that uses functions + * that are not registered an error will be thrown. + * + * If not planning on serialising the pipeline then registering pipeline functions + * is not necessary. + * + * @constructor + */ +lunr.Pipeline = function () { + this._stack = [] +} + +lunr.Pipeline.registeredFunctions = Object.create(null) + +/** + * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token + * string as well as all known metadata. A pipeline function can mutate the token string + * or mutate (or add) metadata for a given token. + * + * A pipeline function can indicate that the passed token should be discarded by returning + * null. This token will not be passed to any downstream pipeline functions and will not be + * added to the index. + * + * Multiple tokens can be returned by returning an array of tokens. Each token will be passed + * to any downstream pipeline functions and all will returned tokens will be added to the index. + * + * Any number of pipeline functions may be chained together using a lunr.Pipeline. + * + * @interface lunr.PipelineFunction + * @param {lunr.Token} token - A token from the document being processed. + * @param {number} i - The index of this token in the complete list of tokens for this document/field. + * @param {lunr.Token[]} tokens - All tokens for this document/field. + * @returns {(?lunr.Token|lunr.Token[])} + */ + +/** + * Register a function with the pipeline. + * + * Functions that are used in the pipeline should be registered if the pipeline + * needs to be serialised, or a serialised pipeline needs to be loaded. + * + * Registering a function does not add it to a pipeline, functions must still be + * added to instances of the pipeline for them to be used when running a pipeline. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @param {String} label - The label to register this function with + */ +lunr.Pipeline.registerFunction = function (fn, label) { + if (label in this.registeredFunctions) { + lunr.utils.warn('Overwriting existing registered function: ' + label) + } + + fn.label = label + lunr.Pipeline.registeredFunctions[fn.label] = fn +} + +/** + * Warns if the function is not registered as a Pipeline function. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @private + */ +lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { + var isRegistered = fn.label && (fn.label in this.registeredFunctions) + + if (!isRegistered) { + lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + } +} + +/** + * Loads a previously serialised pipeline. + * + * All functions to be loaded must already be registered with lunr.Pipeline. + * If any function from the serialised data has not been registered then an + * error will be thrown. + * + * @param {Object} serialised - The serialised pipeline to load. + * @returns {lunr.Pipeline} + */ +lunr.Pipeline.load = function (serialised) { + var pipeline = new lunr.Pipeline + + serialised.forEach(function (fnName) { + var fn = lunr.Pipeline.registeredFunctions[fnName] + + if (fn) { + pipeline.add(fn) + } else { + throw new Error('Cannot load unregistered function: ' + fnName) + } + }) + + return pipeline +} + +/** + * Adds new functions to the end of the pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. + */ +lunr.Pipeline.prototype.add = function () { + var fns = Array.prototype.slice.call(arguments) + + fns.forEach(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + this._stack.push(fn) + }, this) +} + +/** + * Adds a single function after a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.after = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + pos = pos + 1 + this._stack.splice(pos, 0, newFn) +} + +/** + * Adds a single function before a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.before = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + this._stack.splice(pos, 0, newFn) +} + +/** + * Removes a function from the pipeline. + * + * @param {lunr.PipelineFunction} fn The function to remove from the pipeline. + */ +lunr.Pipeline.prototype.remove = function (fn) { + var pos = this._stack.indexOf(fn) + if (pos == -1) { + return + } + + this._stack.splice(pos, 1) +} + +/** + * Runs the current list of functions that make up the pipeline against the + * passed tokens. + * + * @param {Array} tokens The tokens to run through the pipeline. + * @returns {Array} + */ +lunr.Pipeline.prototype.run = function (tokens) { + var stackLength = this._stack.length + + for (var i = 0; i < stackLength; i++) { + var fn = this._stack[i] + + tokens = tokens.reduce(function (memo, token, j) { + var result = fn(token, j, tokens) + + if (result === void 0 || result === '') return memo + + return memo.concat(result) + }, []) + } + + return tokens +} + +/** + * Convenience method for passing a string through a pipeline and getting + * strings out. This method takes care of wrapping the passed string in a + * token and mapping the resulting tokens back to strings. + * + * @param {string} str - The string to pass through the pipeline. + * @returns {string[]} + */ +lunr.Pipeline.prototype.runString = function (str) { + var token = new lunr.Token (str) + + return this.run([token]).map(function (t) { + return t.toString() + }) +} + +/** + * Resets the pipeline by removing any existing processors. + * + */ +lunr.Pipeline.prototype.reset = function () { + this._stack = [] +} + +/** + * Returns a representation of the pipeline ready for serialisation. + * + * Logs a warning if the function has not been registered. + * + * @returns {Array} + */ +lunr.Pipeline.prototype.toJSON = function () { + return this._stack.map(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + + return fn.label + }) +} +/*! + * lunr.Vector + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * A vector is used to construct the vector space of documents and queries. These + * vectors support operations to determine the similarity between two documents or + * a document and a query. + * + * Normally no parameters are required for initializing a vector, but in the case of + * loading a previously dumped vector the raw elements can be provided to the constructor. + * + * For performance reasons vectors are implemented with a flat array, where an elements + * index is immediately followed by its value. E.g. [index, value, index, value]. This + * allows the underlying array to be as sparse as possible and still offer decent + * performance when being used for vector calculations. + * + * @constructor + * @param {Number[]} [elements] - The flat list of element index and element value pairs. + */ +lunr.Vector = function (elements) { + this._magnitude = 0 + this.elements = elements || [] +} + + +/** + * Calculates the position within the vector to insert a given index. + * + * This is used internally by insert and upsert. If there are duplicate indexes then + * the position is returned as if the value for that index were to be updated, but it + * is the callers responsibility to check whether there is a duplicate at that index + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @returns {Number} + */ +lunr.Vector.prototype.positionForIndex = function (index) { + // For an empty vector the tuple can be inserted at the beginning + if (this.elements.length == 0) { + return 0 + } + + var start = 0, + end = this.elements.length / 2, + sliceLength = end - start, + pivotPoint = Math.floor(sliceLength / 2), + pivotIndex = this.elements[pivotPoint * 2] + + while (sliceLength > 1) { + if (pivotIndex < index) { + start = pivotPoint + } + + if (pivotIndex > index) { + end = pivotPoint + } + + if (pivotIndex == index) { + break + } + + sliceLength = end - start + pivotPoint = start + Math.floor(sliceLength / 2) + pivotIndex = this.elements[pivotPoint * 2] + } + + if (pivotIndex == index) { + return pivotPoint * 2 + } + + if (pivotIndex > index) { + return pivotPoint * 2 + } + + if (pivotIndex < index) { + return (pivotPoint + 1) * 2 + } +} + +/** + * Inserts an element at an index within the vector. + * + * Does not allow duplicates, will throw an error if there is already an entry + * for this index. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + */ +lunr.Vector.prototype.insert = function (insertIdx, val) { + this.upsert(insertIdx, val, function () { + throw "duplicate index" + }) +} + +/** + * Inserts or updates an existing index within the vector. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + * @param {function} fn - A function that is called for updates, the existing value and the + * requested value are passed as arguments + */ +lunr.Vector.prototype.upsert = function (insertIdx, val, fn) { + this._magnitude = 0 + var position = this.positionForIndex(insertIdx) + + if (this.elements[position] == insertIdx) { + this.elements[position + 1] = fn(this.elements[position + 1], val) + } else { + this.elements.splice(position, 0, insertIdx, val) + } +} + +/** + * Calculates the magnitude of this vector. + * + * @returns {Number} + */ +lunr.Vector.prototype.magnitude = function () { + if (this._magnitude) return this._magnitude + + var sumOfSquares = 0, + elementsLength = this.elements.length + + for (var i = 1; i < elementsLength; i += 2) { + var val = this.elements[i] + sumOfSquares += val * val + } + + return this._magnitude = Math.sqrt(sumOfSquares) +} + +/** + * Calculates the dot product of this vector and another vector. + * + * @param {lunr.Vector} otherVector - The vector to compute the dot product with. + * @returns {Number} + */ +lunr.Vector.prototype.dot = function (otherVector) { + var dotProduct = 0, + a = this.elements, b = otherVector.elements, + aLen = a.length, bLen = b.length, + aVal = 0, bVal = 0, + i = 0, j = 0 + + while (i < aLen && j < bLen) { + aVal = a[i], bVal = b[j] + if (aVal < bVal) { + i += 2 + } else if (aVal > bVal) { + j += 2 + } else if (aVal == bVal) { + dotProduct += a[i + 1] * b[j + 1] + i += 2 + j += 2 + } + } + + return dotProduct +} + +/** + * Calculates the cosine similarity between this vector and another + * vector. + * + * @param {lunr.Vector} otherVector - The other vector to calculate the + * similarity with. + * @returns {Number} + */ +lunr.Vector.prototype.similarity = function (otherVector) { + return this.dot(otherVector) / (this.magnitude() * otherVector.magnitude()) +} + +/** + * Converts the vector to an array of the elements within the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toArray = function () { + var output = new Array (this.elements.length / 2) + + for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) { + output[j] = this.elements[i] + } + + return output +} + +/** + * A JSON serializable representation of the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toJSON = function () { + return this.elements +} +/* eslint-disable */ +/*! + * lunr.stemmer + * Copyright (C) 2017 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ + +/** + * lunr.stemmer is an english language stemmer, this is a JavaScript + * implementation of the PorterStemmer taken from http://tartarus.org/~martin + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token - The string to stem + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stemmer = (function(){ + var step2list = { + "ational" : "ate", + "tional" : "tion", + "enci" : "ence", + "anci" : "ance", + "izer" : "ize", + "bli" : "ble", + "alli" : "al", + "entli" : "ent", + "eli" : "e", + "ousli" : "ous", + "ization" : "ize", + "ation" : "ate", + "ator" : "ate", + "alism" : "al", + "iveness" : "ive", + "fulness" : "ful", + "ousness" : "ous", + "aliti" : "al", + "iviti" : "ive", + "biliti" : "ble", + "logi" : "log" + }, + + step3list = { + "icate" : "ic", + "ative" : "", + "alize" : "al", + "iciti" : "ic", + "ical" : "ic", + "ful" : "", + "ness" : "" + }, + + c = "[^aeiou]", // consonant + v = "[aeiouy]", // vowel + C = c + "[^aeiouy]*", // consonant sequence + V = v + "[aeiou]*", // vowel sequence + + mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 + meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 + mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 + s_v = "^(" + C + ")?" + v; // vowel in stem + + var re_mgr0 = new RegExp(mgr0); + var re_mgr1 = new RegExp(mgr1); + var re_meq1 = new RegExp(meq1); + var re_s_v = new RegExp(s_v); + + var re_1a = /^(.+?)(ss|i)es$/; + var re2_1a = /^(.+?)([^s])s$/; + var re_1b = /^(.+?)eed$/; + var re2_1b = /^(.+?)(ed|ing)$/; + var re_1b_2 = /.$/; + var re2_1b_2 = /(at|bl|iz)$/; + var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$"); + var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var re_1c = /^(.+?[^aeiou])y$/; + var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + + var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + + var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + var re2_4 = /^(.+?)(s|t)(ion)$/; + + var re_5 = /^(.+?)e$/; + var re_5_1 = /ll$/; + var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var porterStemmer = function porterStemmer(w) { + var stem, + suffix, + firstch, + re, + re2, + re3, + re4; + + if (w.length < 3) { return w; } + + firstch = w.substr(0,1); + if (firstch == "y") { + w = firstch.toUpperCase() + w.substr(1); + } + + // Step 1a + re = re_1a + re2 = re2_1a; + + if (re.test(w)) { w = w.replace(re,"$1$2"); } + else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } + + // Step 1b + re = re_1b; + re2 = re2_1b; + if (re.test(w)) { + var fp = re.exec(w); + re = re_mgr0; + if (re.test(fp[1])) { + re = re_1b_2; + w = w.replace(re,""); + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = re_s_v; + if (re2.test(stem)) { + w = stem; + re2 = re2_1b_2; + re3 = re3_1b_2; + re4 = re4_1b_2; + if (re2.test(w)) { w = w + "e"; } + else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); } + else if (re4.test(w)) { w = w + "e"; } + } + } + + // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say) + re = re_1c; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "i"; + } + + // Step 2 + re = re_2; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step2list[suffix]; + } + } + + // Step 3 + re = re_3; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step3list[suffix]; + } + } + + // Step 4 + re = re_4; + re2 = re2_4; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + if (re.test(stem)) { + w = stem; + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = re_mgr1; + if (re2.test(stem)) { + w = stem; + } + } + + // Step 5 + re = re_5; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + re2 = re_meq1; + re3 = re3_5; + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { + w = stem; + } + } + + re = re_5_1; + re2 = re_mgr1; + if (re.test(w) && re2.test(w)) { + re = re_1b_2; + w = w.replace(re,""); + } + + // and turn initial Y back to y + + if (firstch == "y") { + w = firstch.toLowerCase() + w.substr(1); + } + + return w; + }; + + return function (token) { + return token.update(porterStemmer); + } +})(); + +lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') +/*! + * lunr.stopWordFilter + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.generateStopWordFilter builds a stopWordFilter function from the provided + * list of stop words. + * + * The built in lunr.stopWordFilter is built using this generator and can be used + * to generate custom stopWordFilters for applications or non English languages. + * + * @param {Array} token The token to pass through the filter + * @returns {lunr.PipelineFunction} + * @see lunr.Pipeline + * @see lunr.stopWordFilter + */ +lunr.generateStopWordFilter = function (stopWords) { + var words = stopWords.reduce(function (memo, stopWord) { + memo[stopWord] = stopWord + return memo + }, {}) + + return function (token) { + if (token && words[token.toString()] !== token.toString()) return token + } +} + +/** + * lunr.stopWordFilter is an English language stop word list filter, any words + * contained in the list will not be passed through the filter. + * + * This is intended to be used in the Pipeline. If the token does not pass the + * filter then undefined will be returned. + * + * @implements {lunr.PipelineFunction} + * @params {lunr.Token} token - A token to check for being a stop word. + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stopWordFilter = lunr.generateStopWordFilter([ + 'a', + 'able', + 'about', + 'across', + 'after', + 'all', + 'almost', + 'also', + 'am', + 'among', + 'an', + 'and', + 'any', + 'are', + 'as', + 'at', + 'be', + 'because', + 'been', + 'but', + 'by', + 'can', + 'cannot', + 'could', + 'dear', + 'did', + 'do', + 'does', + 'either', + 'else', + 'ever', + 'every', + 'for', + 'from', + 'get', + 'got', + 'had', + 'has', + 'have', + 'he', + 'her', + 'hers', + 'him', + 'his', + 'how', + 'however', + 'i', + 'if', + 'in', + 'into', + 'is', + 'it', + 'its', + 'just', + 'least', + 'let', + 'like', + 'likely', + 'may', + 'me', + 'might', + 'most', + 'must', + 'my', + 'neither', + 'no', + 'nor', + 'not', + 'of', + 'off', + 'often', + 'on', + 'only', + 'or', + 'other', + 'our', + 'own', + 'rather', + 'said', + 'say', + 'says', + 'she', + 'should', + 'since', + 'so', + 'some', + 'than', + 'that', + 'the', + 'their', + 'them', + 'then', + 'there', + 'these', + 'they', + 'this', + 'tis', + 'to', + 'too', + 'twas', + 'us', + 'wants', + 'was', + 'we', + 'were', + 'what', + 'when', + 'where', + 'which', + 'while', + 'who', + 'whom', + 'why', + 'will', + 'with', + 'would', + 'yet', + 'you', + 'your' +]) + +lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') +/*! + * lunr.trimmer + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.trimmer is a pipeline function for trimming non word + * characters from the beginning and end of tokens before they + * enter the index. + * + * This implementation may not work correctly for non latin + * characters and should either be removed or adapted for use + * with languages with non-latin characters. + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token The token to pass through the filter + * @returns {lunr.Token} + * @see lunr.Pipeline + */ +lunr.trimmer = function (token) { + return token.update(function (s) { + return s.replace(/^\W+/, '').replace(/\W+$/, '') + }) +} + +lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') +/*! + * lunr.TokenSet + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * A token set is used to store the unique list of all tokens + * within an index. Token sets are also used to represent an + * incoming query to the index, this query token set and index + * token set are then intersected to find which tokens to look + * up in the inverted index. + * + * A token set can hold multiple tokens, as in the case of the + * index token set, or it can hold a single token as in the + * case of a simple query token set. + * + * Additionally token sets are used to perform wildcard matching. + * Leading, contained and trailing wildcards are supported, and + * from this edit distance matching can also be provided. + * + * Token sets are implemented as a minimal finite state automata, + * where both common prefixes and suffixes are shared between tokens. + * This helps to reduce the space used for storing the token set. + * + * @constructor + */ +lunr.TokenSet = function () { + this.final = false + this.edges = {} + this.id = lunr.TokenSet._nextId + lunr.TokenSet._nextId += 1 +} + +/** + * Keeps track of the next, auto increment, identifier to assign + * to a new tokenSet. + * + * TokenSets require a unique identifier to be correctly minimised. + * + * @private + */ +lunr.TokenSet._nextId = 1 + +/** + * Creates a TokenSet instance from the given sorted array of words. + * + * @param {String[]} arr - A sorted array of strings to create the set from. + * @returns {lunr.TokenSet} + * @throws Will throw an error if the input array is not sorted. + */ +lunr.TokenSet.fromArray = function (arr) { + var builder = new lunr.TokenSet.Builder + + for (var i = 0, len = arr.length; i < len; i++) { + builder.insert(arr[i]) + } + + builder.finish() + return builder.root +} + +/** + * Creates a token set from a query clause. + * + * @private + * @param {Object} clause - A single clause from lunr.Query. + * @param {string} clause.term - The query clause term. + * @param {number} [clause.editDistance] - The optional edit distance for the term. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromClause = function (clause) { + if ('editDistance' in clause) { + return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance) + } else { + return lunr.TokenSet.fromString(clause.term) + } +} + +/** + * Creates a token set representing a single string with a specified + * edit distance. + * + * Insertions, deletions, substitutions and transpositions are each + * treated as an edit distance of 1. + * + * Increasing the allowed edit distance will have a dramatic impact + * on the performance of both creating and intersecting these TokenSets. + * It is advised to keep the edit distance less than 3. + * + * @param {string} str - The string to create the token set from. + * @param {number} editDistance - The allowed edit distance to match. + * @returns {lunr.Vector} + */ +lunr.TokenSet.fromFuzzyString = function (str, editDistance) { + var root = new lunr.TokenSet + + var stack = [{ + node: root, + editsRemaining: editDistance, + str: str + }] + + while (stack.length) { + var frame = stack.pop() + + // no edit + if (frame.str.length > 0) { + var char = frame.str.charAt(0), + noEditNode + + if (char in frame.node.edges) { + noEditNode = frame.node.edges[char] + } else { + noEditNode = new lunr.TokenSet + frame.node.edges[char] = noEditNode + } + + if (frame.str.length == 1) { + noEditNode.final = true + } else { + stack.push({ + node: noEditNode, + editsRemaining: frame.editsRemaining, + str: frame.str.slice(1) + }) + } + } + + // deletion + // can only do a deletion if we have enough edits remaining + // and if there are characters left to delete in the string + if (frame.editsRemaining > 0 && frame.str.length > 1) { + var char = frame.str.charAt(1), + deletionNode + + if (char in frame.node.edges) { + deletionNode = frame.node.edges[char] + } else { + deletionNode = new lunr.TokenSet + frame.node.edges[char] = deletionNode + } + + if (frame.str.length <= 2) { + deletionNode.final = true + } else { + stack.push({ + node: deletionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(2) + }) + } + } + + // deletion + // just removing the last character from the str + if (frame.editsRemaining > 0 && frame.str.length == 1) { + frame.node.final = true + } + + // substitution + // can only do a substitution if we have enough edits remaining + // and if there are characters left to substitute + if (frame.editsRemaining > 0 && frame.str.length >= 1) { + if ("*" in frame.node.edges) { + var substitutionNode = frame.node.edges["*"] + } else { + var substitutionNode = new lunr.TokenSet + frame.node.edges["*"] = substitutionNode + } + + if (frame.str.length == 1) { + substitutionNode.final = true + } else { + stack.push({ + node: substitutionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + } + + // insertion + // can only do insertion if there are edits remaining + if (frame.editsRemaining > 0) { + if ("*" in frame.node.edges) { + var insertionNode = frame.node.edges["*"] + } else { + var insertionNode = new lunr.TokenSet + frame.node.edges["*"] = insertionNode + } + + if (frame.str.length == 0) { + insertionNode.final = true + } else { + stack.push({ + node: insertionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str + }) + } + } + + // transposition + // can only do a transposition if there are edits remaining + // and there are enough characters to transpose + if (frame.editsRemaining > 0 && frame.str.length > 1) { + var charA = frame.str.charAt(0), + charB = frame.str.charAt(1), + transposeNode + + if (charB in frame.node.edges) { + transposeNode = frame.node.edges[charB] + } else { + transposeNode = new lunr.TokenSet + frame.node.edges[charB] = transposeNode + } + + if (frame.str.length == 1) { + transposeNode.final = true + } else { + stack.push({ + node: transposeNode, + editsRemaining: frame.editsRemaining - 1, + str: charA + frame.str.slice(2) + }) + } + } + } + + return root +} + +/** + * Creates a TokenSet from a string. + * + * The string may contain one or more wildcard characters (*) + * that will allow wildcard matching when intersecting with + * another TokenSet. + * + * @param {string} str - The string to create a TokenSet from. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromString = function (str) { + var node = new lunr.TokenSet, + root = node, + wildcardFound = false + + /* + * Iterates through all characters within the passed string + * appending a node for each character. + * + * As soon as a wildcard character is found then a self + * referencing edge is introduced to continually match + * any number of any characters. + */ + for (var i = 0, len = str.length; i < len; i++) { + var char = str[i], + final = (i == len - 1) + + if (char == "*") { + wildcardFound = true + node.edges[char] = node + node.final = final + + } else { + var next = new lunr.TokenSet + next.final = final + + node.edges[char] = next + node = next + + // TODO: is this needed anymore? + if (wildcardFound) { + node.edges["*"] = root + } + } + } + + return root +} + +/** + * Converts this TokenSet into an array of strings + * contained within the TokenSet. + * + * @returns {string[]} + */ +lunr.TokenSet.prototype.toArray = function () { + var words = [] + + var stack = [{ + prefix: "", + node: this + }] + + while (stack.length) { + var frame = stack.pop(), + edges = Object.keys(frame.node.edges), + len = edges.length + + if (frame.node.final) { + words.push(frame.prefix) + } + + for (var i = 0; i < len; i++) { + var edge = edges[i] + + stack.push({ + prefix: frame.prefix.concat(edge), + node: frame.node.edges[edge] + }) + } + } + + return words +} + +/** + * Generates a string representation of a TokenSet. + * + * This is intended to allow TokenSets to be used as keys + * in objects, largely to aid the construction and minimisation + * of a TokenSet. As such it is not designed to be a human + * friendly representation of the TokenSet. + * + * @returns {string} + */ +lunr.TokenSet.prototype.toString = function () { + // NOTE: Using Object.keys here as this.edges is very likely + // to enter 'hash-mode' with many keys being added + // + // avoiding a for-in loop here as it leads to the function + // being de-optimised (at least in V8). From some simple + // benchmarks the performance is comparable, but allowing + // V8 to optimize may mean easy performance wins in the future. + + if (this._str) { + return this._str + } + + var str = this.final ? '1' : '0', + labels = Object.keys(this.edges).sort(), + len = labels.length + + for (var i = 0; i < len; i++) { + var label = labels[i], + node = this.edges[label] + + str = str + label + node.id + } + + return str +} + +/** + * Returns a new TokenSet that is the intersection of + * this TokenSet and the passed TokenSet. + * + * This intersection will take into account any wildcards + * contained within the TokenSet. + * + * @param {lunr.TokenSet} b - An other TokenSet to intersect with. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.prototype.intersect = function (b) { + var output = new lunr.TokenSet, + frame = undefined + + var stack = [{ + qNode: b, + output: output, + node: this + }] + + while (stack.length) { + frame = stack.pop() + + // NOTE: As with the #toString method, we are using + // Object.keys and a for loop instead of a for-in loop + // as both of these objects enter 'hash' mode, causing + // the function to be de-optimised in V8 + var qEdges = Object.keys(frame.qNode.edges), + qLen = qEdges.length, + nEdges = Object.keys(frame.node.edges), + nLen = nEdges.length + + for (var q = 0; q < qLen; q++) { + var qEdge = qEdges[q] + + for (var n = 0; n < nLen; n++) { + var nEdge = nEdges[n] + + if (nEdge == qEdge || qEdge == '*') { + var node = frame.node.edges[nEdge], + qNode = frame.qNode.edges[qEdge], + final = node.final && qNode.final, + next = undefined + + if (nEdge in frame.output.edges) { + // an edge already exists for this character + // no need to create a new node, just set the finality + // bit unless this node is already final + next = frame.output.edges[nEdge] + next.final = next.final || final + + } else { + // no edge exists yet, must create one + // set the finality bit and insert it + // into the output + next = new lunr.TokenSet + next.final = final + frame.output.edges[nEdge] = next + } + + stack.push({ + qNode: qNode, + output: next, + node: node + }) + } + } + } + } + + return output +} +lunr.TokenSet.Builder = function () { + this.previousWord = "" + this.root = new lunr.TokenSet + this.uncheckedNodes = [] + this.minimizedNodes = {} +} + +lunr.TokenSet.Builder.prototype.insert = function (word) { + var node, + commonPrefix = 0 + + if (word < this.previousWord) { + throw new Error ("Out of order word insertion") + } + + for (var i = 0; i < word.length && i < this.previousWord.length; i++) { + if (word[i] != this.previousWord[i]) break + commonPrefix++ + } + + this.minimize(commonPrefix) + + if (this.uncheckedNodes.length == 0) { + node = this.root + } else { + node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child + } + + for (var i = commonPrefix; i < word.length; i++) { + var nextNode = new lunr.TokenSet, + char = word[i] + + node.edges[char] = nextNode + + this.uncheckedNodes.push({ + parent: node, + char: char, + child: nextNode + }) + + node = nextNode + } + + node.final = true + this.previousWord = word +} + +lunr.TokenSet.Builder.prototype.finish = function () { + this.minimize(0) +} + +lunr.TokenSet.Builder.prototype.minimize = function (downTo) { + for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) { + var node = this.uncheckedNodes[i], + childKey = node.child.toString() + + if (childKey in this.minimizedNodes) { + node.parent.edges[node.char] = this.minimizedNodes[childKey] + } else { + // Cache the key for this node since + // we know it can't change anymore + node.child._str = childKey + + this.minimizedNodes[childKey] = node.child + } + + this.uncheckedNodes.pop() + } +} +/*! + * lunr.Index + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * An index contains the built index of all documents and provides a query interface + * to the index. + * + * Usually instances of lunr.Index will not be created using this constructor, instead + * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be + * used to load previously built and serialized indexes. + * + * @constructor + * @param {Object} attrs - The attributes of the built search index. + * @param {Object} attrs.invertedIndex - An index of term/field to document reference. + * @param {Object} attrs.documentVectors - Document vectors keyed by document reference. + * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. + * @param {string[]} attrs.fields - The names of indexed document fields. + * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. + */ +lunr.Index = function (attrs) { + this.invertedIndex = attrs.invertedIndex + this.fieldVectors = attrs.fieldVectors + this.tokenSet = attrs.tokenSet + this.fields = attrs.fields + this.pipeline = attrs.pipeline +} + +/** + * A result contains details of a document matching a search query. + * @typedef {Object} lunr.Index~Result + * @property {string} ref - The reference of the document this result represents. + * @property {number} score - A number between 0 and 1 representing how similar this document is to the query. + * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match. + */ + +/** + * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple + * query language which itself is parsed into an instance of lunr.Query. + * + * For programmatically building queries it is advised to directly use lunr.Query, the query language + * is best used for human entered text rather than program generated text. + * + * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported + * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello' + * or 'world', though those that contain both will rank higher in the results. + * + * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can + * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding + * wildcards will increase the number of documents that will be found but can also have a negative + * impact on query performance, especially with wildcards at the beginning of a term. + * + * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term + * hello in the title field will match this query. Using a field not present in the index will lead + * to an error being thrown. + * + * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term + * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported + * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. + * Avoid large values for edit distance to improve query performance. + * + * To escape special characters the backslash character '\' can be used, this allows searches to include + * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead + * of attempting to apply a boost of 2 to the search term "foo". + * + * @typedef {string} lunr.Index~QueryString + * @example Simple single term query + * hello + * @example Multiple term query + * hello world + * @example term scoped to a field + * title:hello + * @example term with a boost of 10 + * hello^10 + * @example term with an edit distance of 2 + * hello~2 + */ + +/** + * Performs a search against the index using lunr query syntax. + * + * Results will be returned sorted by their score, the most relevant results + * will be returned first. + * + * For more programmatic querying use lunr.Index#query. + * + * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. + * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.search = function (queryString) { + return this.query(function (query) { + var parser = new lunr.QueryParser(queryString, query) + parser.parse() + }) +} + +/** + * A query builder callback provides a query object to be used to express + * the query to perform on the index. + * + * @callback lunr.Index~queryBuilder + * @param {lunr.Query} query - The query object to build up. + * @this lunr.Query + */ + +/** + * Performs a query against the index using the yielded lunr.Query object. + * + * If performing programmatic queries against the index, this method is preferred + * over lunr.Index#search so as to avoid the additional query parsing overhead. + * + * A query object is yielded to the supplied function which should be used to + * express the query to be run against the index. + * + * Note that although this function takes a callback parameter it is _not_ an + * asynchronous operation, the callback is just yielded a query object to be + * customized. + * + * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.query = function (fn) { + // for each query clause + // * process terms + // * expand terms from token set + // * find matching documents and metadata + // * get document vectors + // * score documents + + var query = new lunr.Query(this.fields), + matchingFields = Object.create(null), + queryVectors = Object.create(null), + termFieldCache = Object.create(null) + + fn.call(query, query) + + for (var i = 0; i < query.clauses.length; i++) { + /* + * Unless the pipeline has been disabled for this term, which is + * the case for terms with wildcards, we need to pass the clause + * term through the search pipeline. A pipeline returns an array + * of processed terms. Pipeline functions may expand the passed + * term, which means we may end up performing multiple index lookups + * for a single query term. + */ + var clause = query.clauses[i], + terms = null + + if (clause.usePipeline) { + terms = this.pipeline.runString(clause.term) + } else { + terms = [clause.term] + } + + for (var m = 0; m < terms.length; m++) { + var term = terms[m] + + /* + * Each term returned from the pipeline needs to use the same query + * clause object, e.g. the same boost and or edit distance. The + * simplest way to do this is to re-use the clause object but mutate + * its term property. + */ + + clause = JSON.parse(JSON.stringify(clause)) + clause.term = term + + /* + * From the term in the clause we create a token set which will then + * be used to intersect the indexes token set to get a list of terms + * to lookup in the inverted index + */ + var termTokenSet = lunr.TokenSet.fromClause(clause), + expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() + + for (var j = 0; j < expandedTerms.length; j++) { + /* + * For each term get the posting and termIndex, this is required for + * building the query vector. + */ + var expandedTerm = expandedTerms[j]; + var posting = this.invertedIndex[expandedTerm]; + if (posting) { + var termIndex = posting._index; + } else { + continue; + } + for (var k = 0; k < clause.fields.length; k++) { + /* + * For each field that this query term is scoped by (by default + * all fields are in scope) we need to get all the document refs + * that have this term in that field. + * + * The posting is the entry in the invertedIndex for the matching + * term from above. + */ + var field = clause.fields[k], + fieldPosting = posting[field], + matchingDocumentRefs = Object.keys(fieldPosting), + termField = expandedTerm + "/" + field + + /* + * To support field level boosts a query vector is created per + * field. This vector is populated using the termIndex found for + * the term and a unit value with the appropriate boost applied. + * + * If the query vector for this field does not exist yet it needs + * to be created. + */ + if (queryVectors[field] === undefined) { + queryVectors[field] = new lunr.Vector + } + + /* + * Using upsert because there could already be an entry in the vector + * for the term we are working with. In that case we just add the scores + * together. + */ + queryVectors[field].upsert(termIndex, 1 * clause.boost, function (a, b) { return a + b }) + + /** + * If we've already seen this term, field combo then we've already collected + * the matching documents and metadata, no need to go through all that again + */ + if (termFieldCache[termField]) { + continue + } + + for (var l = 0; l < matchingDocumentRefs.length; l++) { + /* + * All metadata for this term/field/document triple + * are then extracted and collected into an instance + * of lunr.MatchData ready to be returned in the query + * results + */ + var matchingDocumentRef = matchingDocumentRefs[l], + matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field), + metadata = fieldPosting[matchingDocumentRef], + fieldMatch + + if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) { + matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata) + } else { + fieldMatch.add(expandedTerm, field, metadata) + } + + } + + termFieldCache[termField] = true + } + } + } + } + + var matchingFieldRefs = Object.keys(matchingFields), + results = [], + matches = Object.create(null) + + for (var i = 0; i < matchingFieldRefs.length; i++) { + /* + * Currently we have document fields that match the query, but we + * need to return documents. The matchData and scores are combined + * from multiple fields belonging to the same document. + * + * Scores are calculated by field, using the query vectors created + * above, and combined into a final document score using addition. + */ + var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), + docRef = fieldRef.docRef, + fieldVector = this.fieldVectors[fieldRef], + score = queryVectors[fieldRef.fieldName].similarity(fieldVector), + docMatch + + if ((docMatch = matches[docRef]) !== undefined) { + docMatch.score += score + docMatch.matchData.combine(matchingFields[fieldRef]) + } else { + var match = { + ref: docRef, + score: score, + matchData: matchingFields[fieldRef] + } + matches[docRef] = match + results.push(match) + } + } + + /* + * Sort the results objects by score, highest first. + */ + return results.sort(function (a, b) { + return b.score - a.score + }) +} + +/** + * Prepares the index for JSON serialization. + * + * The schema for this JSON blob will be described in a + * separate JSON schema file. + * + * @returns {Object} + */ +lunr.Index.prototype.toJSON = function () { + var invertedIndex = Object.keys(this.invertedIndex) + .sort() + .map(function (term) { + return [term, this.invertedIndex[term]] + }, this) + + var fieldVectors = Object.keys(this.fieldVectors) + .map(function (ref) { + return [ref, this.fieldVectors[ref].toJSON()] + }, this) + + return { + version: lunr.version, + fields: this.fields, + fieldVectors: fieldVectors, + invertedIndex: invertedIndex, + pipeline: this.pipeline.toJSON() + } +} + +/** + * Loads a previously serialized lunr.Index + * + * @param {Object} serializedIndex - A previously serialized lunr.Index + * @returns {lunr.Index} + */ +lunr.Index.load = function (serializedIndex) { + var attrs = {}, + fieldVectors = {}, + serializedVectors = serializedIndex.fieldVectors, + invertedIndex = {}, + serializedInvertedIndex = serializedIndex.invertedIndex, + tokenSetBuilder = new lunr.TokenSet.Builder, + pipeline = lunr.Pipeline.load(serializedIndex.pipeline) + + if (serializedIndex.version != lunr.version) { + lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + } + + for (var i = 0; i < serializedVectors.length; i++) { + var tuple = serializedVectors[i], + ref = tuple[0], + elements = tuple[1] + + fieldVectors[ref] = new lunr.Vector(elements) + } + + for (var i = 0; i < serializedInvertedIndex.length; i++) { + var tuple = serializedInvertedIndex[i], + term = tuple[0], + posting = tuple[1] + + tokenSetBuilder.insert(term) + invertedIndex[term] = posting + } + + tokenSetBuilder.finish() + + attrs.fields = serializedIndex.fields + + attrs.fieldVectors = fieldVectors + attrs.invertedIndex = invertedIndex + attrs.tokenSet = tokenSetBuilder.root + attrs.pipeline = pipeline + + return new lunr.Index(attrs) +} +/*! + * lunr.Builder + * Copyright (C) 2017 Oliver Nightingale + */ + +/** + * lunr.Builder performs indexing on a set of documents and + * returns instances of lunr.Index ready for querying. + * + * All configuration of the index is done via the builder, the + * fields to index, the document reference, the text processing + * pipeline and document scoring parameters are all set on the + * builder before indexing. + * + * @constructor + * @property {string} _ref - Internal reference to the document reference field. + * @property {string[]} _fields - Internal reference to the document fields to index. + * @property {object} invertedIndex - The inverted index maps terms to document fields. + * @property {object} documentTermFrequencies - Keeps track of document term frequencies. + * @property {object} documentLengths - Keeps track of the length of documents added to the index. + * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing. + * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing. + * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index. + * @property {number} documentCount - Keeps track of the total number of documents indexed. + * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75. + * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2. + * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space. + * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index. + */ +lunr.Builder = function () { + this._ref = "id" + this._fields = [] + this.invertedIndex = Object.create(null) + this.fieldTermFrequencies = {} + this.fieldLengths = {} + this.tokenizer = lunr.tokenizer + this.pipeline = new lunr.Pipeline + this.searchPipeline = new lunr.Pipeline + this.documentCount = 0 + this._b = 0.75 + this._k1 = 1.2 + this.termIndex = 0 + this.metadataWhitelist = [] +} + +/** + * Sets the document field used as the document reference. Every document must have this field. + * The type of this field in the document should be a string, if it is not a string it will be + * coerced into a string by calling toString. + * + * The default ref is 'id'. + * + * The ref should _not_ be changed during indexing, it should be set before any documents are + * added to the index. Changing it during indexing can lead to inconsistent results. + * + * @param {string} ref - The name of the reference field in the document. + */ +lunr.Builder.prototype.ref = function (ref) { + this._ref = ref +} + +/** + * Adds a field to the list of document fields that will be indexed. Every document being + * indexed should have this field. Null values for this field in indexed documents will + * not cause errors but will limit the chance of that document being retrieved by searches. + * + * All fields should be added before adding documents to the index. Adding fields after + * a document has been indexed will have no effect on already indexed documents. + * + * @param {string} field - The name of a field to index in all documents. + */ +lunr.Builder.prototype.field = function (field) { + this._fields.push(field) +} + +/** + * A parameter to tune the amount of field length normalisation that is applied when + * calculating relevance scores. A value of 0 will completely disable any normalisation + * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b + * will be clamped to the range 0 - 1. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.b = function (number) { + if (number < 0) { + this._b = 0 + } else if (number > 1) { + this._b = 1 + } else { + this._b = number + } +} + +/** + * A parameter that controls the speed at which a rise in term frequency results in term + * frequency saturation. The default value is 1.2. Setting this to a higher value will give + * slower saturation levels, a lower value will result in quicker saturation. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.k1 = function (number) { + this._k1 = number +} + +/** + * Adds a document to the index. + * + * Before adding fields to the index the index should have been fully setup, with the document + * ref and all fields to index already having been specified. + * + * The document must have a field name as specified by the ref (by default this is 'id') and + * it should have all fields defined for indexing, though null or undefined values will not + * cause errors. + * + * @param {object} doc - The document to add to the index. + */ +lunr.Builder.prototype.add = function (doc) { + var docRef = doc[this._ref] + + this.documentCount += 1 + + for (var i = 0; i < this._fields.length; i++) { + var fieldName = this._fields[i], + field = doc[fieldName], + tokens = this.tokenizer(field), + terms = this.pipeline.run(tokens), + fieldRef = new lunr.FieldRef (docRef, fieldName), + fieldTerms = Object.create(null) + + this.fieldTermFrequencies[fieldRef] = fieldTerms + this.fieldLengths[fieldRef] = 0 + + // store the length of this field for this document + this.fieldLengths[fieldRef] += terms.length + + // calculate term frequencies for this field + for (var j = 0; j < terms.length; j++) { + var term = terms[j] + + if (fieldTerms[term] == undefined) { + fieldTerms[term] = 0 + } + + fieldTerms[term] += 1 + + // add to inverted index + // create an initial posting if one doesn't exist + if (this.invertedIndex[term] == undefined) { + var posting = Object.create(null) + posting["_index"] = this.termIndex + this.termIndex += 1 + + for (var k = 0; k < this._fields.length; k++) { + posting[this._fields[k]] = Object.create(null) + } + + this.invertedIndex[term] = posting + } + + // add an entry for this term/fieldName/docRef to the invertedIndex + if (this.invertedIndex[term][fieldName][docRef] == undefined) { + this.invertedIndex[term][fieldName][docRef] = Object.create(null) + } + + // store all whitelisted metadata about this token in the + // inverted index + for (var l = 0; l < this.metadataWhitelist.length; l++) { + var metadataKey = this.metadataWhitelist[l], + metadata = term.metadata[metadataKey] + + if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) { + this.invertedIndex[term][fieldName][docRef][metadataKey] = [] + } + + this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata) + } + } + + } +} + +/** + * Calculates the average document length for this index + * + * @private + */ +lunr.Builder.prototype.calculateAverageFieldLengths = function () { + + var fieldRefs = Object.keys(this.fieldLengths), + numberOfFields = fieldRefs.length, + accumulator = {}, + documentsWithField = {} + + for (var i = 0; i < numberOfFields; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName + + documentsWithField[field] || (documentsWithField[field] = 0) + documentsWithField[field] += 1 + + accumulator[field] || (accumulator[field] = 0) + accumulator[field] += this.fieldLengths[fieldRef] + } + + for (var i = 0; i < this._fields.length; i++) { + var field = this._fields[i] + accumulator[field] = accumulator[field] / documentsWithField[field] + } + + this.averageFieldLength = accumulator +} + +/** + * Builds a vector space model of every document using lunr.Vector + * + * @private + */ +lunr.Builder.prototype.createFieldVectors = function () { + var fieldVectors = {}, + fieldRefs = Object.keys(this.fieldTermFrequencies), + fieldRefsLength = fieldRefs.length, + termIdfCache = Object.create(null) + + for (var i = 0; i < fieldRefsLength; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName, + fieldLength = this.fieldLengths[fieldRef], + fieldVector = new lunr.Vector, + termFrequencies = this.fieldTermFrequencies[fieldRef], + terms = Object.keys(termFrequencies), + termsLength = terms.length + + for (var j = 0; j < termsLength; j++) { + var term = terms[j], + tf = termFrequencies[term], + termIndex = this.invertedIndex[term]._index, + idf, score, scoreWithPrecision + + if (termIdfCache[term] === undefined) { + idf = lunr.idf(this.invertedIndex[term], this.documentCount) + termIdfCache[term] = idf + } else { + idf = termIdfCache[term] + } + + score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[field])) + tf) + scoreWithPrecision = Math.round(score * 1000) / 1000 + // Converts 1.23456789 to 1.234. + // Reducing the precision so that the vectors take up less + // space when serialised. Doing it now so that they behave + // the same before and after serialisation. Also, this is + // the fastest approach to reducing a number's precision in + // JavaScript. + + fieldVector.insert(termIndex, scoreWithPrecision) + } + + fieldVectors[fieldRef] = fieldVector + } + + this.fieldVectors = fieldVectors +} + +/** + * Creates a token set of all tokens in the index using lunr.TokenSet + * + * @private + */ +lunr.Builder.prototype.createTokenSet = function () { + this.tokenSet = lunr.TokenSet.fromArray( + Object.keys(this.invertedIndex).sort() + ) +} + +/** + * Builds the index, creating an instance of lunr.Index. + * + * This completes the indexing process and should only be called + * once all documents have been added to the index. + * + * @returns {lunr.Index} + */ +lunr.Builder.prototype.build = function () { + this.calculateAverageFieldLengths() + this.createFieldVectors() + this.createTokenSet() + + return new lunr.Index({ + invertedIndex: this.invertedIndex, + fieldVectors: this.fieldVectors, + tokenSet: this.tokenSet, + fields: this._fields, + pipeline: this.searchPipeline + }) +} + +/** + * Applies a plugin to the index builder. + * + * A plugin is a function that is called with the index builder as its context. + * Plugins can be used to customise or extend the behaviour of the index + * in some way. A plugin is just a function, that encapsulated the custom + * behaviour that should be applied when building the index. + * + * The plugin function will be called with the index builder as its argument, additional + * arguments can also be passed when calling use. The function will be called + * with the index builder as its context. + * + * @param {Function} plugin The plugin to apply. + */ +lunr.Builder.prototype.use = function (fn) { + var args = Array.prototype.slice.call(arguments, 1) + args.unshift(this) + fn.apply(this, args) +} +/** + * Contains and collects metadata about a matching document. + * A single instance of lunr.MatchData is returned as part of every + * lunr.Index~Result. + * + * @constructor + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + * @property {object} metadata - A cloned collection of metadata associated with this document. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData = function (term, field, metadata) { + var clonedMetadata = Object.create(null), + metadataKeys = Object.keys(metadata) + + // Cloning the metadata to prevent the original + // being mutated during match data combination. + // Metadata is kept in an array within the inverted + // index so cloning the data can be done with + // Array#slice + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + clonedMetadata[key] = metadata[key].slice() + } + + this.metadata = Object.create(null) + this.metadata[term] = Object.create(null) + this.metadata[term][field] = clonedMetadata +} + +/** + * An instance of lunr.MatchData will be created for every term that matches a + * document. However only one instance is required in a lunr.Index~Result. This + * method combines metadata from another instance of lunr.MatchData with this + * objects metadata. + * + * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData.prototype.combine = function (otherMatchData) { + var terms = Object.keys(otherMatchData.metadata) + + for (var i = 0; i < terms.length; i++) { + var term = terms[i], + fields = Object.keys(otherMatchData.metadata[term]) + + if (this.metadata[term] == undefined) { + this.metadata[term] = Object.create(null) + } + + for (var j = 0; j < fields.length; j++) { + var field = fields[j], + keys = Object.keys(otherMatchData.metadata[term][field]) + + if (this.metadata[term][field] == undefined) { + this.metadata[term][field] = Object.create(null) + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k] + + if (this.metadata[term][field][key] == undefined) { + this.metadata[term][field][key] = otherMatchData.metadata[term][field][key] + } else { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key]) + } + + } + } + } +} + +/** + * Add metadata for a term/field pair to this instance of match data. + * + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + */ +lunr.MatchData.prototype.add = function (term, field, metadata) { + if (!(term in this.metadata)) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = metadata + return + } + + if (!(field in this.metadata[term])) { + this.metadata[term][field] = metadata + return + } + + var metadataKeys = Object.keys(metadata) + + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + + if (key in this.metadata[term][field]) { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key]) + } else { + this.metadata[term][field][key] = metadata[key] + } + } +} +/** + * A lunr.Query provides a programmatic way of defining queries to be performed + * against a {@link lunr.Index}. + * + * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method + * so the query object is pre-initialized with the right index fields. + * + * @constructor + * @property {lunr.Query~Clause[]} clauses - An array of query clauses. + * @property {string[]} allFields - An array of all available fields in a lunr.Index. + */ +lunr.Query = function (allFields) { + this.clauses = [] + this.allFields = allFields +} + +/** + * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause. + * + * This allows wildcards to be added to the beginning and end of a term without having to manually do any string + * concatenation. + * + * The wildcard constants can be bitwise combined to select both leading and trailing wildcards. + * + * @constant + * @default + * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour + * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists + * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with trailing wildcard + * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING }) + * @example query term with leading and trailing wildcard + * query.term('foo', { + * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING + * }) + */ +lunr.Query.wildcard = new String ("*") +lunr.Query.wildcard.NONE = 0 +lunr.Query.wildcard.LEADING = 1 +lunr.Query.wildcard.TRAILING = 2 + +/** + * A single clause in a {@link lunr.Query} contains a term and details on how to + * match that term against a {@link lunr.Index}. + * + * @typedef {Object} lunr.Query~Clause + * @property {string[]} fields - The fields in an index this clause should be matched against. + * @property {number} [boost=1] - Any boost that should be applied when matching this clause. + * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. + * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. + * @property {number} [wildcard=0] - Whether the term should have wildcards appended or prepended. + */ + +/** + * Adds a {@link lunr.Query~Clause} to this query. + * + * Unless the clause contains the fields to be matched all fields will be matched. In addition + * a default boost of 1 is applied to the clause. + * + * @param {lunr.Query~Clause} clause - The clause to add to this query. + * @see lunr.Query~Clause + * @returns {lunr.Query} + */ +lunr.Query.prototype.clause = function (clause) { + if (!('fields' in clause)) { + clause.fields = this.allFields + } + + if (!('boost' in clause)) { + clause.boost = 1 + } + + if (!('usePipeline' in clause)) { + clause.usePipeline = true + } + + if (!('wildcard' in clause)) { + clause.wildcard = lunr.Query.wildcard.NONE + } + + if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) { + clause.term = "*" + clause.term + } + + if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) { + clause.term = "" + clause.term + "*" + } + + this.clauses.push(clause) + + return this +} + +/** + * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} + * to the list of clauses that make up this query. + * + * @param {string} term - The term to add to the query. + * @param {Object} [options] - Any additional properties to add to the query clause. + * @returns {lunr.Query} + * @see lunr.Query#clause + * @see lunr.Query~Clause + * @example adding a single term to a query + * query.term("foo") + * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard + * query.term("foo", { + * fields: ["title"], + * boost: 10, + * wildcard: lunr.Query.wildcard.TRAILING + * }) + */ +lunr.Query.prototype.term = function (term, options) { + var clause = options || {} + clause.term = term + + this.clause(clause) + + return this +} +lunr.QueryParseError = function (message, start, end) { + this.name = "QueryParseError" + this.message = message + this.start = start + this.end = end +} + +lunr.QueryParseError.prototype = new Error +lunr.QueryLexer = function (str) { + this.lexemes = [] + this.str = str + this.length = str.length + this.pos = 0 + this.start = 0 + this.escapeCharPositions = [] +} + +lunr.QueryLexer.prototype.run = function () { + var state = lunr.QueryLexer.lexText + + while (state) { + state = state(this) + } +} + +lunr.QueryLexer.prototype.sliceString = function () { + var subSlices = [], + sliceStart = this.start, + sliceEnd = this.pos + + for (var i = 0; i < this.escapeCharPositions.length; i++) { + sliceEnd = this.escapeCharPositions[i] + subSlices.push(this.str.slice(sliceStart, sliceEnd)) + sliceStart = sliceEnd + 1 + } + + subSlices.push(this.str.slice(sliceStart, this.pos)) + this.escapeCharPositions.length = 0 + + return subSlices.join('') +} + +lunr.QueryLexer.prototype.emit = function (type) { + this.lexemes.push({ + type: type, + str: this.sliceString(), + start: this.start, + end: this.pos + }) + + this.start = this.pos +} + +lunr.QueryLexer.prototype.escapeCharacter = function () { + this.escapeCharPositions.push(this.pos - 1) + this.pos += 1 +} + +lunr.QueryLexer.prototype.next = function () { + if (this.pos >= this.length) { + return lunr.QueryLexer.EOS + } + + var char = this.str.charAt(this.pos) + this.pos += 1 + return char +} + +lunr.QueryLexer.prototype.width = function () { + return this.pos - this.start +} + +lunr.QueryLexer.prototype.ignore = function () { + if (this.start == this.pos) { + this.pos += 1 + } + + this.start = this.pos +} + +lunr.QueryLexer.prototype.backup = function () { + this.pos -= 1 +} + +lunr.QueryLexer.prototype.acceptDigitRun = function () { + var char, charCode + + do { + char = this.next() + charCode = char.charCodeAt(0) + } while (charCode > 47 && charCode < 58) + + if (char != lunr.QueryLexer.EOS) { + this.backup() + } +} + +lunr.QueryLexer.prototype.more = function () { + return this.pos < this.length +} + +lunr.QueryLexer.EOS = 'EOS' +lunr.QueryLexer.FIELD = 'FIELD' +lunr.QueryLexer.TERM = 'TERM' +lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' +lunr.QueryLexer.BOOST = 'BOOST' + +lunr.QueryLexer.lexField = function (lexer) { + lexer.backup() + lexer.emit(lunr.QueryLexer.FIELD) + lexer.ignore() + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexTerm = function (lexer) { + if (lexer.width() > 1) { + lexer.backup() + lexer.emit(lunr.QueryLexer.TERM) + } + + lexer.ignore() + + if (lexer.more()) { + return lunr.QueryLexer.lexText + } +} + +lunr.QueryLexer.lexEditDistance = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.EDIT_DISTANCE) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexBoost = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.BOOST) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexEOS = function (lexer) { + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } +} + +// This matches the separator used when tokenising fields +// within a document. These should match otherwise it is +// not possible to search for some tokens within a document. +// +// It is possible for the user to change the separator on the +// tokenizer so it _might_ clash with any other of the special +// characters already used within the search string, e.g. :. +// +// This means that it is possible to change the separator in +// such a way that makes some words unsearchable using a search +// string. +lunr.QueryLexer.termSeparator = lunr.tokenizer.separator + +lunr.QueryLexer.lexText = function (lexer) { + while (true) { + var char = lexer.next() + + if (char == lunr.QueryLexer.EOS) { + return lunr.QueryLexer.lexEOS + } + + // Escape character is '\' + if (char.charCodeAt(0) == 92) { + lexer.escapeCharacter() + continue + } + + if (char == ":") { + return lunr.QueryLexer.lexField + } + + if (char == "~") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexEditDistance + } + + if (char == "^") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexBoost + } + + if (char.match(lunr.QueryLexer.termSeparator)) { + return lunr.QueryLexer.lexTerm + } + } +} + +lunr.QueryParser = function (str, query) { + this.lexer = new lunr.QueryLexer (str) + this.query = query + this.currentClause = {} + this.lexemeIdx = 0 +} + +lunr.QueryParser.prototype.parse = function () { + this.lexer.run() + this.lexemes = this.lexer.lexemes + + var state = lunr.QueryParser.parseFieldOrTerm + + while (state) { + state = state(this) + } + + return this.query +} + +lunr.QueryParser.prototype.peekLexeme = function () { + return this.lexemes[this.lexemeIdx] +} + +lunr.QueryParser.prototype.consumeLexeme = function () { + var lexeme = this.peekLexeme() + this.lexemeIdx += 1 + return lexeme +} + +lunr.QueryParser.prototype.nextClause = function () { + var completedClause = this.currentClause + this.query.clause(completedClause) + this.currentClause = {} +} + +lunr.QueryParser.parseFieldOrTerm = function (parser) { + var lexeme = parser.peekLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.type) { + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expected either a field or a term, found " + lexeme.type + + if (lexeme.str.length >= 1) { + errorMessage += " with value '" + lexeme.str + "'" + } + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } +} + +lunr.QueryParser.parseField = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + if (parser.query.allFields.indexOf(lexeme.str) == -1) { + var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '), + errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.fields = [lexeme.str] + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseTerm = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + parser.currentClause.term = lexeme.str.toLowerCase() + + if (lexeme.str.indexOf("*") != -1) { + parser.currentClause.usePipeline = false + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseEditDistance = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var editDistance = parseInt(lexeme.str, 10) + + if (isNaN(editDistance)) { + var errorMessage = "edit distance must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.editDistance = editDistance + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseBoost = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var boost = parseInt(lexeme.str, 10) + + if (isNaN(boost)) { + var errorMessage = "boost must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.boost = boost + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + + /** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ + ;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like enviroments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + root.lunr = factory() + } + }(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + return lunr + })) +})(); diff --git a/assets/js/search.js b/assets/js/search.js new file mode 100644 index 0000000000000..a967fc7e9cfe9 --- /dev/null +++ b/assets/js/search.js @@ -0,0 +1,44 @@ +$(document).ready(function() { + 'use strict'; + var search_field = $('.search-form__field'), + search_results = $('.search-results'), + toggle_search = $('.toggle-search-button'), + close_search = $('.close-search-button'), + search_result_template = "\ +
\ + {{title}}\ + \ +
"; + + toggle_search.click(function(event) { + event.preventDefault(); + $('.search-form-container').addClass('is-active'); + + setTimeout(function() { + search_field.focus(); + }, 500); + }); + + $('.search-form-container').on('keyup', function(event) { + if (event.keyCode == 27) { + $('.search-form-container').removeClass('is-active'); + } + }); + + $('.close-search-button').click(function() { + $('.search-form-container').removeClass('is-active'); + }); + + search_field.ghostHunter({ + results: search_results, + onKeyUp : true, + rss : base_url + '/feed.xml', + zeroResultsInfo : false, + info_template : "

Number of posts found: {{amount}}

", + result_template : search_result_template, + before: function() { + search_results.fadeIn(); + } + }); + + }); \ No newline at end of file diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000000000..fc43e17184324 --- /dev/null +++ b/feed.xml @@ -0,0 +1,38 @@ +--- +layout: null +--- + + + + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} + {{ site.url }}{{ site.baseurl }}/ + + {{ site.time | date_to_rfc822 }} + {{ site.time | date_to_rfc822 }} + Jekyll v{{ jekyll.version }} + + {% for post in site.posts %} + + {{ post.title | xml_escape }} + {{ post.content | xml_escape }} + {{ post.date | date_to_rfc822 }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + + {% endfor %} + + {% for page in site.pages %} + {% if page.layout == 'page' %} + {% if page.name != '404.md' %} + + {{ page.title | xml_escape }} + {{ page.content | xml_escape }} + {{ page.url | prepend: site.baseurl | prepend: site.url }} + + {% endif %} + {% endif %} + {% endfor %} + + + \ No newline at end of file diff --git a/search.md b/search.md deleted file mode 100644 index 31ff962604238..0000000000000 --- a/search.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Search -menus: header -layout: search -permalink: /search ---- \ No newline at end of file