Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
docpad-plugin-cloudant
Advanced tools
Readme
Cloudant Importer Plugin for DocPad
Import Cloudant collections into DocPad collections.
(Cloudant is a hosted CouchDB-compatible database from IBM with a fairly generous free tier.)
Based on https://github.com/nfriedly/docpad-plugin-mongodb
docpad install cloudant
Add the following to your docpad configuration file:
plugins:
cloudant:
collections: [
cloudantConfig: {account: "foo", password: "bar"} // passed directly to the [node.js client](https://github.com/cloudant/nodejs-cloudant), so a `url` is also accepted
dbName: "posts"
collectionName: "blog_posts" # defaults to dbName
relativeDirPath: "blog" # defaults to dbName
extension: ".html" # defaults to .json
meta:
layout: "blogpost"
]
As imported documents are just like normal documents, you can also list them just as you would other documents. Here is an example of a index.html.eco
file that would output the titles and links to all the blog posts from the simple example above:
<h2>Blog:</h2>
<ul><% for post in @getCollection('posts').toJSON(): %>
<li>
<a href="<%= post.url %>"><%= post.title %></a>
</li>
<% end %></ul>
This allows you to limit and adjust the data in the cloundant database before downloading it to the docpad database.
plugins:
cloudant:
collections: [
cloudantConfig: {account: "foo", password: "bar"} // passed directly to the [node.js client](https://github.com/cloudant/nodejs-cloudant), so a `url` is also accepted
dbName: "posts"
collectionName: "my_view_collection"
viewDocument:
_id: "_design/my_design_document"
views:
my_view:
# the map function is sent to couchdb as a string.. but you can just wrap a regular function in parenthesis and call .toString() on it ;)
map: ((doc) ->
emit doc._id, doc
).toString()
alwaysReplaceViewDocument: false # When true, the existing view is deleted and recreated before fetching the documents. (This is handy when you're updating your view function.)
]
Copyright (c) 20154 Nathan Friedly - http://nfriedly.com/
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.
FAQs
Import your Cloudant databases to DocPad collections
We found that docpad-plugin-cloudant demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).