Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
docpad-plugin-cloudant
Advanced tools
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
The npm package docpad-plugin-cloudant receives a total of 0 weekly downloads. As such, docpad-plugin-cloudant popularity was classified as not popular.
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.