diff --git a/.eslintrc.json b/.eslintrc.json index ff9cd97756..7bbbd50e17 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -36,6 +36,7 @@ "eol-last": "error", "no-empty": "off", "no-console": "off", + "no-tabs": "error", "no-trailing-spaces": "error", "semi": ["error", "always"], "curly": ["error", "all"], diff --git a/bin/build-site.js b/bin/build-site.js index 62b35c9e17..87e57ffa2c 100755 --- a/bin/build-site.js +++ b/bin/build-site.js @@ -2,9 +2,7 @@ 'use strict'; -var http_server = require('http-server'); var fs = require('fs'); -var watchGlob = require('watch-glob'); var replace = require('replace'); var exec = require('child-process-promise').exec; var mkdirp = require('mkdirp'); @@ -72,6 +70,9 @@ function buildEverything() { } if (!process.env.BUILD) { + const http_server = require('http-server'); + const watchGlob = require('watch-glob'); + watchGlob('**', buildJekyll); watchGlob('docs/static/less/*/*.less', buildCSS); http_server.createServer({root: '_site', cache: '-1'}).listen(4000); diff --git a/bin/run-test.sh b/bin/run-test.sh index a18adebd51..0e6648b95d 100755 --- a/bin/run-test.sh +++ b/bin/run-test.sh @@ -1,5 +1,12 @@ #!/bin/bash -e +cleanup() { + if [[ ! -z $SERVER_PID ]]; then + kill $SERVER_PID + fi +} +trap cleanup EXIT + # Run tests against a local setup of pouchdb-express-router # by default unless COUCH_HOST is specified. [ -z "$COUCH_HOST" -a -z "$SERVER" ] && SERVER="pouchdb-express-router" @@ -13,8 +20,7 @@ pouchdb-setup-server() { # in CI, link pouchdb-servers dependencies on pouchdb # modules to the current implementations if [ -d "pouchdb-server-install" ]; then - # pouchdb server already running - exit 0 + rm -rf pouchdb-server-install fi mkdir pouchdb-server-install cd pouchdb-server-install @@ -135,9 +141,3 @@ elif [ "$CLIENT" == "dev" ]; then else npm run test-browser fi - -EXIT_STATUS=$? -if [[ ! -z $SERVER_PID ]]; then - kill $SERVER_PID -fi -exit $EXIT_STATUS diff --git a/bin/update-package-json-for-publish.js b/bin/update-package-json-for-publish.js index b5c1e993c2..2c5b70fc9f 100644 --- a/bin/update-package-json-for-publish.js +++ b/bin/update-package-json-for-publish.js @@ -62,7 +62,7 @@ modules.forEach(function (mod) { // Also add "module" member: https://github.com/rollup/rollup/wiki/pkg.module pkg['jsnext:main'] = pkg.module = './lib/index.es.js'; // whitelist the files we'll actually publish - pkg.files = ['lib', 'dist', 'tonic-example.js']; + pkg.files = ['lib', 'dist']; var jsonString = JSON.stringify(pkg, null, ' ') + '\n'; fs.writeFileSync(pkgPath, jsonString, 'utf8'); diff --git a/docs/_guides/async-code.md b/docs/_guides/async-code.md index f6f6ce9ee8..7be73c8969 100644 --- a/docs/_guides/async-code.md +++ b/docs/_guides/async-code.md @@ -50,7 +50,7 @@ If you already understand promises, you can [skip to the next section](updating- {% markdown %} **What about async/await?** Async functions are an experimental ES7 syntax that enhances promise-based APIs by adding -the `async` and `await` keywords. For more information about `async`/`await`, read [our introductory blog post](http://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.html). +the `async` and `await` keywords. For more information about `async`/`await`, read [our introductory blog post]({{ site.baseurl }}/2015/03/05/taming-the-async-beast-with-es7.html). {% endmarkdown %} {% include alert/end.html%} diff --git a/docs/_guides/bulk-operations.md b/docs/_guides/bulk-operations.md index 127b101b64..fb487c6524 100644 --- a/docs/_guides/bulk-operations.md +++ b/docs/_guides/bulk-operations.md @@ -120,7 +120,7 @@ You can see **[a live example](http://bl.ocks.org/nolanlawson/8f58dbc360348a4c95 Far too many developers overlook this valuable API, because they misunderstand it. When a developer says "my PouchDB app is slow!", it is usually because they are using the slow `query()` API when they should be using the fast `allDocs()` API. -For details on how to effectively use `allDocs()`, you are strongly recommended to read ["Pagination strategies with PouchDB"](http://pouchdb.com/2014/04/14/pagination-strategies-with-pouchdb.html). For 99% of your applications, you should be able to use `allDocs()` for all the pagination/sorting/searching functionality that you need. +For details on how to effectively use `allDocs()`, you are strongly recommended to read ["Pagination strategies with PouchDB"]({{ site.baseurl }}/2014/04/14/pagination-strategies-with-pouchdb.html). For 99% of your applications, you should be able to use `allDocs()` for all the pagination/sorting/searching functionality that you need. {% include anchor.html title="Related API documentation" hash="related-api-documentation" %} diff --git a/docs/_guides/index.md b/docs/_guides/index.md index c45b5cdde6..04cada5790 100644 --- a/docs/_guides/index.md +++ b/docs/_guides/index.md @@ -8,7 +8,7 @@ sidebar: guides_nav.html Welcome to the PouchDB guide! Consider this your starting point for anything and everything related to the world of PouchDB and CouchDB. -For a quicker TodoMVC-based tutorial, you can also check out the ["Getting Started" guide](/getting-started.html). +For a quicker TodoMVC-based tutorial, you can also check out the ["Getting Started" guide]({{ site.baseurl }}/getting-started.html). Feel free to skip ahead using the sidebar at any time. diff --git a/docs/_guides/mango-queries.md b/docs/_guides/mango-queries.md index 14b632467d..ffc4c265aa 100644 --- a/docs/_guides/mango-queries.md +++ b/docs/_guides/mango-queries.md @@ -105,7 +105,7 @@ db.find({ }); ``` -In this case, we only get 10 documents back, but they are the first 10 documents, sorted by name. This means that we have only read 10 documents out of the database into memory, which can be used for [efficient pagination](http://pouchdb.com/2014/04/14/pagination-strategies-with-pouchdb.html). +In this case, we only get 10 documents back, but they are the first 10 documents, sorted by name. This means that we have only read 10 documents out of the database into memory, which can be used for [efficient pagination]({{ site.baseurl }}/2014/04/14/pagination-strategies-with-pouchdb.html). For instance, if we are displaying the first 10 results on a single page, and the user clicks "next" to see the next page, we can restructure our query based on the last result, to continue the pagination. Let's imagine the first 10 documents' `name`s are: diff --git a/docs/_guides/queries.md b/docs/_guides/queries.md index bad87e4f2d..7c57c4ec35 100644 --- a/docs/_guides/queries.md +++ b/docs/_guides/queries.md @@ -219,7 +219,7 @@ pouch.query(myMapReduceFun, { }); ``` -If you're adventurous, though, you should check out the [CouchDB documentation](http://couchdb.readthedocs.org/en/latest/couchapp/views/intro.html) or the [PouchDB documentation](http://pouchdb.com/api.html#query_database) for details on reduce functions. +If you're adventurous, though, you should check out the [CouchDB documentation](http://couchdb.readthedocs.org/en/latest/couchapp/views/intro.html) or the [PouchDB documentation]({{ site.baseurl }}/api.html#query_database) for details on reduce functions. {% include anchor.html title="Avoiding map/reduce" hash="avoiding-map-reduce" %} diff --git a/docs/_guides/replication.md b/docs/_guides/replication.md index 7968f0c089..0906b363a8 100644 --- a/docs/_guides/replication.md +++ b/docs/_guides/replication.md @@ -171,7 +171,7 @@ Any PouchDB object can replicate to any other PouchDB object. So for instance, y This can be very powerful, because it enables lots of fancy scenarios. For example: -1. You have an [in-memory PouchDB](http://pouchdb.com/adapters.html#pouchdb_in_the_browser) that replicates with a local PouchDB, acting as a cache. +1. You have an [in-memory PouchDB]({{ site.baseurl }}/adapters.html#pouchdb_in_the_browser) that replicates with a local PouchDB, acting as a cache. 2. You have many remote CouchDB databases that the user may access, and they are all replicated to the same local PouchDB. 3. You have many local PouchDB databases, which are mirrored to a single remote CouchDB as a backup store. diff --git a/docs/_includes/api/create_document.html b/docs/_includes/api/create_document.html index 3f10f12473..a8c563d2d9 100644 --- a/docs/_includes/api/create_document.html +++ b/docs/_includes/api/create_document.html @@ -9,7 +9,7 @@ If you want to update an existing document even if there's conflict, you should specify the base revision `_rev` and use `force=true` option, then a new conflict revision will be created. -`doc` must be a "pure JSON object", i.e. a collection of name/value pairs. If you try to store non-JSON data (for instance `Date` objects) you may see [inconsistent results](http://pouchdb.com/errors.html#could_not_be_cloned). +`doc` must be a "pure JSON object", i.e. a collection of name/value pairs. If you try to store non-JSON data (for instance `Date` objects) you may see [inconsistent results]({{ site.baseurl }}/errors.html#could_not_be_cloned). #### Example Usage: diff --git a/docs/_includes/api/delete_document.html b/docs/_includes/api/delete_document.html index ebb5e2b86a..22b894e4f9 100644 --- a/docs/_includes/api/delete_document.html +++ b/docs/_includes/api/delete_document.html @@ -13,7 +13,7 @@ Deletes the document. `doc` is required to be a document with at least an `_id` and a `_rev` property. Sending the full document will work as well. -See [filtered replication](http://pouchdb.com/api.html#filtered-replication) for why you might want to use `put()` with `{_deleted: true}` instead. +See [filtered replication]({{ site.baseurl }}/api.html#filtered-replication) for why you might want to use `put()` with `{_deleted: true}` instead. #### Example Usage: diff --git a/docs/_includes/api/overview.html b/docs/_includes/api/overview.html index 7c7584e048..02df9305fd 100644 --- a/docs/_includes/api/overview.html +++ b/docs/_includes/api/overview.html @@ -52,7 +52,7 @@ } {% endhighlight %} -Any `await` not inside of an async function is a syntax error. For more information about `async`/`await`, read [our introductory blog post](http://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.html). +Any `await` not inside of an async function is a syntax error. For more information about `async`/`await`, read [our introductory blog post]({{ site.baseurl }}/2015/03/05/taming-the-async-beast-with-es7.html). [promise]: https://www.promisejs.org/ [lie]: https://github.com/calvinmetcalf/lie diff --git a/docs/_includes/api/save_attachment.html b/docs/_includes/api/save_attachment.html index 53e95d2cee..cfb2812349 100644 --- a/docs/_includes/api/save_attachment.html +++ b/docs/_includes/api/save_attachment.html @@ -8,7 +8,7 @@ This method will update an existing document to add the attachment, so it requires a `rev` if the document already exists. If the document doesn't already exist, then this method will create an empty document containing the attachment. -What's the point of attachments? If you're dealing with large binary data (such as PNGs), you may incur a performance or storage penalty if you naïvely include them as base64- or hex-encoded strings inside your documents. But if you insert the binary data as an attachment, then PouchDB will attempt to store it in [the most efficient way possible](http://pouchdb.com/faq.html#data_types). +What's the point of attachments? If you're dealing with large binary data (such as PNGs), you may incur a performance or storage penalty if you naïvely include them as base64- or hex-encoded strings inside your documents. But if you insert the binary data as an attachment, then PouchDB will attempt to store it in [the most efficient way possible]({{ site.baseurl }}/faq.html#data_types). For details, see the [CouchDB documentation on attachments](https://docs.couchdb.org/en/stable/api/document/attachments.html#put--db-docid-attname). diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index ae0692c69a..24edabf26d 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -21,7 +21,7 @@ })(); - +
diff --git a/docs/_posts/2014-04-14-pagination-strategies-with-pouchdb.md b/docs/_posts/2014-04-14-pagination-strategies-with-pouchdb.md index a1191aff32..42072f5a41 100644 --- a/docs/_posts/2014-04-14-pagination-strategies-with-pouchdb.md +++ b/docs/_posts/2014-04-14-pagination-strategies-with-pouchdb.md @@ -34,7 +34,7 @@ pouch.bulkDocs({docs : docs}, function (err, response) { }); ``` -Now, the simplest kind of Pouch query, called [`allDocs()`](http://pouchdb.com/api.html#batch_fetch), doesn't do any pagination by default. As the name implies, it just returns all the docs: +Now, the simplest kind of Pouch query, called [`allDocs()`]({{ site.baseurl }}/api.html#batch_fetch), doesn't do any pagination by default. As the name implies, it just returns all the docs: ```javascript pouch.allDocs(function (err, response) { @@ -421,6 +421,6 @@ So congratulations, you're now a [Page Master]! Try to use your newfound powers [couch-query-api]: https://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options [js-string-ordering]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#Comparing_strings [collation-specification]: http://docs.couchdb.org/en/latest/couchapp/views/collation.html#collation-specification - [query-api]: http://pouchdb.com/api.html#query_database + [query-api]: {{ site.baseurl }}/api.html#query_database [page master]: https://en.wikipedia.org/wiki/Pagemaster - [remove]: http://pouchdb.com/api.html#delete_document + [remove]: {{ site.baseurl }}/api.html#delete_document diff --git a/docs/_posts/2014-05-01-secondary-indexes-have-landed-in-pouchdb.md b/docs/_posts/2014-05-01-secondary-indexes-have-landed-in-pouchdb.md index 5a461ea8a9..720117ff05 100644 --- a/docs/_posts/2014-05-01-secondary-indexes-have-landed-in-pouchdb.md +++ b/docs/_posts/2014-05-01-secondary-indexes-have-landed-in-pouchdb.md @@ -133,7 +133,7 @@ pouch.query(myMapFunction, { {% include alert/start.html variant="info"%} -The pagination options forquery()
– i.e., startkey
/endkey
/key
/keys
/skip
/limit
/descending
– are exactly the same as with allDocs()
. For a beginner's guide to pagination, read Pagination strategies with PouchDB.
+The pagination options for query()
– i.e., startkey
/endkey
/key
/keys
/skip
/limit
/descending
– are exactly the same as with allDocs()
. For a beginner's guide to pagination, read Pagination strategies with PouchDB.
{% include alert/end.html %}
@@ -157,7 +157,7 @@ pouch.query(myMapReduceFun, {
});
```
-If you're adventurous, though, you should check out the [CouchDB documentation](http://couchdb.readthedocs.org/en/latest/couchapp/views/intro.html) or the [PouchDB documentation](http://pouchdb.com/api.html#query_database) for details on reduce functions.
+If you're adventurous, though, you should check out the [CouchDB documentation](http://couchdb.readthedocs.org/en/latest/couchapp/views/intro.html) or the [PouchDB documentation]({{ site.baseurl }}/api.html#query_database) for details on reduce functions.
Map/reduce, reuse, recycle
----------
diff --git a/docs/_posts/2014-06-17-12-pro-tips-for-better-code-with-pouchdb.md b/docs/_posts/2014-06-17-12-pro-tips-for-better-code-with-pouchdb.md
index 877abdbf25..72583e558b 100644
--- a/docs/_posts/2014-06-17-12-pro-tips-for-better-code-with-pouchdb.md
+++ b/docs/_posts/2014-06-17-12-pro-tips-for-better-code-with-pouchdb.md
@@ -109,7 +109,7 @@ You are taking this thing which is meant to sort and organize data, and you're g
### 5. Use plugins
-[PouchDB has plugins](http://pouchdb.com/external.html). Use them, and if inspiration ever strikes, [write your own](https://github.com/pouchdb/plugin-seed)!
+[PouchDB has plugins]({{ site.baseurl }}/external.html). Use them, and if inspiration ever strikes, [write your own](https://github.com/pouchdb/plugin-seed)!
### 6. Don't just update docs for the hell of it
@@ -117,7 +117,7 @@ Every time you modify a document, another revision is added to its revision hist
### 7. Use and abuse your doc IDs
-I already wrote [a blog post about this](http://pouchdb.com/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html), but basically, if you don't want bad performance from your secondary indexes, the best strategy is to avoid secondary indexes altogether. The primary index should be sufficient for sorting and searching in nearly all of your applications, or at least for the hot-path code.
+I already wrote [a blog post about this]({{ site.baseurl }}/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html), but basically, if you don't want bad performance from your secondary indexes, the best strategy is to avoid secondary indexes altogether. The primary index should be sufficient for sorting and searching in nearly all of your applications, or at least for the hot-path code.
Also, if you really want to get fancy with your doc IDs, you can use [PouchDB Collate](https://github.com/pouchdb/collate/) to serialize arbitrary data into strings that are sorted according to [CouchDB collation ordering](https://docs.couchdb.org/en/latest/ddocs/views/collation.html). This allows you to index on arrays, objects, numbers – whatever you want:
@@ -178,7 +178,7 @@ if (!pouch.adapter) { // websql not supported by this browser
### 9. Move logic from the map function to query()
-If you only remember one thing from [my blog post about secondary indexes](http://pouchdb.com/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html), remember this: every `map` function you write has to be executed for every single document in your database. No exceptions.
+If you only remember one thing from [my blog post about secondary indexes]({{ site.baseurl }}/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html), remember this: every `map` function you write has to be executed for every single document in your database. No exceptions.
On the other hand, the `query()` options like `startkey`, `endkey`, `key`, and `keys` have been optimized to hell, and they leverage the native indexes in the database to deliver the maximum possible performance.
@@ -235,7 +235,7 @@ function getPostsBetween(startTime, endTime) {
}
```
-(That `createDesignDoc()` helper function comes from [this blost post](http://pouchdb.com/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html).)
+(That `createDesignDoc()` helper function comes from [this blost post]({{ site.baseurl }}/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html).)
Not only is the above code much simpler, but it's also faster and more tweakable. No need to completely rebuild the index when your query changes; just switch around `startkey`/`endkey`/`descending` and friends at query time to get the data you want.
diff --git a/docs/_posts/2014-07-25-pouchdb-levels-up.md b/docs/_posts/2014-07-25-pouchdb-levels-up.md
index d615d27bec..434b955908 100644
--- a/docs/_posts/2014-07-25-pouchdb-levels-up.md
+++ b/docs/_posts/2014-07-25-pouchdb-levels-up.md
@@ -42,7 +42,7 @@ This brings us back to Nick Thompson's [LevelUP proposal](https://github.com/pou
For instance, there was [a longstanding issue](https://github.com/pouchdb/pouchdb/issues/44) to add LocalStorage support for older browsers like IE 8 and 9. With LevelUP, we could avoid writing an entirely new, fourth adapter and simply plug into [localstorage-down](https://github.com/No9/localstorage-down). And it certainly wouldn't hurt to have Riak, Redis, or an in-memory database as potential backends.
-There was some hemming and hawing (mostly from me), but in the end we decided to cruise ahead with the proposal. (And ultimately, I was happily proven wrong.) Calvin Metcalf deserves the primary credit for integrating [Sublevel](https://github.com/dominictarr/level-sublevel) into the LevelDB adapter, while Adam Shih jumped in to get the new adapter browserified with three different backends: localstorage-down, level-js, and MemDOWN. I put the finishing touches to build them as separate plugins, and as of 2.2.3 they're fully passing the test suite and [ready to use](http://pouchdb.com/adapters.html#pouchdb_in_the_browser).
+There was some hemming and hawing (mostly from me), but in the end we decided to cruise ahead with the proposal. (And ultimately, I was happily proven wrong.) Calvin Metcalf deserves the primary credit for integrating [Sublevel](https://github.com/dominictarr/level-sublevel) into the LevelDB adapter, while Adam Shih jumped in to get the new adapter browserified with three different backends: localstorage-down, level-js, and MemDOWN. I put the finishing touches to build them as separate plugins, and as of 2.2.3 they're fully passing the test suite and [ready to use]({{ site.baseurl }}/adapters.html#pouchdb_in_the_browser).
Additionally, [PouchDB Server](https://github.com/pouchdb/pouchdb-server) has been updated to allow the use of alternate backends via the `--level-backend` option. This provides an instant CouchDB REST API to any LevelUP-compliant datastore – Redis, Riak, MySQL, you name it. There's also a new `--in-memory` option, courtesy of MemDOWN, of course.
diff --git a/docs/_posts/2014-09-04-pouchdb-3.0.4.md b/docs/_posts/2014-09-04-pouchdb-3.0.4.md
index 455fd14854..fc6fec8ae6 100644
--- a/docs/_posts/2014-09-04-pouchdb-3.0.4.md
+++ b/docs/_posts/2014-09-04-pouchdb-3.0.4.md
@@ -7,7 +7,7 @@ author: Calvin Metcalf
---
-This week we present [PouchDB 3.0.4](https://github.com/pouchdb/pouchdb/releases/tag/3.0.4), which fixes a bunch of stuff with attachments. Now the kittens generated by the [3.0.0 release](http://pouchdb.com/2014/08/12/pouchdb-3.0.0.html) may be safely stored in Pouch.
+This week we present [PouchDB 3.0.4](https://github.com/pouchdb/pouchdb/releases/tag/3.0.4), which fixes a bunch of stuff with attachments. Now the kittens generated by the [3.0.0 release]({{ site.baseurl }}/2014/08/12/pouchdb-3.0.0.html) may be safely stored in Pouch.
{% include img.html src="kittens_small.jpg" alt="Kittens" %}
diff --git a/docs/_posts/2014-10-26-10-things-i-learned-from-reading-and-writing-the-pouchdb-source.md b/docs/_posts/2014-10-26-10-things-i-learned-from-reading-and-writing-the-pouchdb-source.md
index 17f82f94d8..e9e35cf76b 100644
--- a/docs/_posts/2014-10-26-10-things-i-learned-from-reading-and-writing-the-pouchdb-source.md
+++ b/docs/_posts/2014-10-26-10-things-i-learned-from-reading-and-writing-the-pouchdb-source.md
@@ -39,7 +39,7 @@ User agent sniffing! Yes, we should be ashamed of ourselves. But here's why we d
* In modern **Chrome** and **Android 4.4+**, the size is simply ignored. The browser calculates the remaining size on disk and sets a limit based on that.
* Aha, but in **Android < 4.4**, this is actually a hard limit! So if you ask for 5000000, you'll only ever get 5 MB.
-* Oh, but in **Safari/iOS**, it gets trickier. If you ask for > 5000000, then it will show an [annoying popup](http://pouchdb.com/errors.html#not_enough_space) when the app is first loaded, which is a great way to spook your users. But if you ask for less, then there's another popup when the database reaches 5MB, and beyond that there's a bug in iOS 7.1 where the browser will no longer show any more popups, so you're forever capped at 10MB. To store more than 10MB, you need to ask for more than 10MB up-front.
+* Oh, but in **Safari/iOS**, it gets trickier. If you ask for > 5000000, then it will show an [annoying popup]({{ site.baseurl }}/errors.html#not_enough_space) when the app is first loaded, which is a great way to spook your users. But if you ask for less, then there's another popup when the database reaches 5MB, and beyond that there's a bug in iOS 7.1 where the browser will no longer show any more popups, so you're forever capped at 10MB. To store more than 10MB, you need to ask for more than 10MB up-front.
* Additionally, if you specify anywhere between 0 and 5000000, Safari and iOS will use that size as a hint for when, precisely, to show the popup. And in the case of PouchDB, we need to avoid the popup in our automated tests, because Selenium doesn't give us a way to press the "OK" button, meaning our tests would just fail if we request too much. So the ideal size to request is 0.
* However, in **PhantomJS** and older WebKit (Safari ~5), if you request 0, then it will blow up.
@@ -226,7 +226,7 @@ var seqCursor = index.openCursor(range);
Did we mess up? Nope, it's intentional: we concatenate the strings together, because [IE does not support complex keys](https://connect.microsoft.com/IE/feedbackdetail/view/866474).
-This also heavily influenced our design for [persistent map/reduce](http://pouchdb.com/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html), because instead of assuming the underlying database can sort by more than one value, we invented [a toIndexableString() function](https://github.com/pouchdb/collate/blob/0e22e6e833e24ee5d677d73df2620c20b58aba1f/lib/index.js#L116-L165) that converts any JSON object into a big CouchDB-collation-ordered string. Yeah, we went there.
+This also heavily influenced our design for [persistent map/reduce]({{ site.baseurl }}/2014/05/01/secondary-indexes-have-landed-in-pouchdb.html), because instead of assuming the underlying database can sort by more than one value, we invented [a toIndexableString() function](https://github.com/pouchdb/collate/blob/0e22e6e833e24ee5d677d73df2620c20b58aba1f/lib/index.js#L116-L165) that converts any JSON object into a big CouchDB-collation-ordered string. Yeah, we went there.
### 6. IndexedDB throws an error if you try to iterate backwards with start/end keys
@@ -415,7 +415,7 @@ What's more intriguing is that you can even find [the influence of CouchDB](http
In a sense, this statement may be the earliest expression of what eventually became PouchDB!
-Furthermore, Google went on to create LevelDB as their implementation of the IndexedDB spec, which is currently enjoying [enormous popularity in the Node.js ecosystem](http://dailyjs.com/2013/04/19/leveldb-and-node-1/), especially thanks to [the LevelUP project](https://github.com/rvagg/node-levelup). PouchDB itself [has hopped on the LevelUP bandwagon](http://pouchdb.com/2014/07/25/pouchdb-levels-up.html), and today we have PouchDB Server, which is a nearly-complete implementation of CouchDB's HTTP API, but based on Node.js and LevelDB.
+Furthermore, Google went on to create LevelDB as their implementation of the IndexedDB spec, which is currently enjoying [enormous popularity in the Node.js ecosystem](http://dailyjs.com/2013/04/19/leveldb-and-node-1/), especially thanks to [the LevelUP project](https://github.com/rvagg/node-levelup). PouchDB itself [has hopped on the LevelUP bandwagon]({{ site.baseurl }}/2014/07/25/pouchdb-levels-up.html), and today we have PouchDB Server, which is a nearly-complete implementation of CouchDB's HTTP API, but based on Node.js and LevelDB.
So from the earliest discussions of IndexedDB, influenced as it was by CouchDB and Web SQL, through LevelDB and the LevelUP ecosystem, we now have a database that unites them all: PouchDB.
diff --git a/docs/_posts/2014-11-10-3.1.0.md b/docs/_posts/2014-11-10-3.1.0.md
index e9a00b6ac4..9fdf1695c1 100644
--- a/docs/_posts/2014-11-10-3.1.0.md
+++ b/docs/_posts/2014-11-10-3.1.0.md
@@ -15,7 +15,7 @@ This release includes a migration. Your existing database will be updated automa
### PouchDB Guides ([#2766](https://github.com/pouchdb/pouchdb/issues/2766))
-Nolan Lawson and Nick Colley worked together to produce some excellent guides to PouchDB which you can see @ [http://pouchdb.com/guides/](http://pouchdb.com/guides/). They cover a lot of the issues surrounding building PouchDB applications including conflicts and promises vs callbacks. As a bonus the guides as well as the rest of the website [now work offline](https://github.com/pouchdb/pouchdb/issues/2957).
+Nolan Lawson and Nick Colley worked together to produce some excellent guides to PouchDB which you can see @ [{{ site.baseurl }}/guides/]({{ site.baseurl }}/guides/). They cover a lot of the issues surrounding building PouchDB applications including conflicts and promises vs callbacks. As a bonus the guides as well as the rest of the website [now work offline](https://github.com/pouchdb/pouchdb/issues/2957).
### Compaction removes orphaned attachments ([#2818](https://github.com/pouchdb/pouchdb/issues/2818))
@@ -27,7 +27,7 @@ There is a big change brewing in CouchDB world, [https://issues.apache.org/jira/
### In related news
-We keep a list of [plugins and related external projects](http://pouchdb.com/external.html) to PouchDB, here are a few new ones we added during this month:
+We keep a list of [plugins and related external projects]({{ site.baseurl }}/external.html) to PouchDB, here are a few new ones we added during this month:
* PouchDB [Dump](https://github.com/nolanlawson/pouchdb-dump-cli) and [Load](https://github.com/nolanlawson/pouchdb-load) are designed to help you load data into your newly started PouchDB app faster than replication will do currently.
* If you want to use PouchDB with Angular, you are in luck, there are now 4! adapters to help you integrate them: [angular-pouchdb](https://github.com/wspringer/angular-pouchdb), [Factoryng](https://github.com/redgeoff/factoryng), [ngPouch](https://github.com/jrhicks/ngPouch), [ng-pouchdb](https://github.com/danielzen/ng-pouchdb).
diff --git a/docs/_posts/2015-02-14-a-quick-one.md b/docs/_posts/2015-02-14-a-quick-one.md
index 42cb2660fe..a14717ee09 100644
--- a/docs/_posts/2015-02-14-a-quick-one.md
+++ b/docs/_posts/2015-02-14-a-quick-one.md
@@ -27,13 +27,13 @@ As noted above, `db.info()` now provides adapter-specific debugging info, such a
* `idb_attachment_format`: (IndexedDB) either `'base64'` or `'binary'`, depending on whether the browser [supports binary blobs](/faq.html#data_types).
* `sqlite_plugin`: (WebSQL) true if the [SQLite Plugin][] is being used.
-* `websql_encoding`: (WebSQL) either `'UTF-8'` or `'UTF-16'`, depending on the [WebSQL implementation](http://pouchdb.com/faq.html#data_types)
+* `websql_encoding`: (WebSQL) either `'UTF-8'` or `'UTF-16'`, depending on the [WebSQL implementation]({{ site.baseurl }}/faq.html#data_types)
This should not be considered a stable API, since it's only for debugging and could change at any time.
### RSS feed
-Thanks to Nick Colley, the PouchDB blog is now available as an RSS feed! Point your RSS reader over to [pouchdb.com/feed.xml](http://pouchdb.com/feed.xml) and get notified whenever a new PouchDB version is released.
+Thanks to Nick Colley, the PouchDB blog is now available as an RSS feed! Point your RSS reader over to [pouchdb.com/feed.xml]({{ site.baseurl }}/feed.xml) and get notified whenever a new PouchDB version is released.
### Couchbase Sync Gateway
diff --git a/docs/_posts/2015-02-28-efficiently-managing-ui-state-in-pouchdb.md b/docs/_posts/2015-02-28-efficiently-managing-ui-state-in-pouchdb.md
index 0a3738a266..609dde61a2 100644
--- a/docs/_posts/2015-02-28-efficiently-managing-ui-state-in-pouchdb.md
+++ b/docs/_posts/2015-02-28-efficiently-managing-ui-state-in-pouchdb.md
@@ -123,6 +123,6 @@ There's no performance benefit to using filter
/view
/