
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
docpad-plugin-mongodb
Advanced tools
Import MongoDB collections into DocPad collections.
Inspired by https://github.com/simonh1000/docpad-plugin-mongo and based on https://github.com/docpad/docpad-plugin-tumblr/
docpad install mongodb
Add the following to your docpad configuration file via:
plugins:
mongodb:
connectionString: "mongodb://localhost/blog" # format is "mongodb://username:password@hostname:port/dbname?options"
collections: [
collectionName: "posts"
relativeDirPath: "blog"
extension: ".md.html"
meta:
layout: "blogpost"
]
The default directory for where the imported documents will go inside is the collectionName.
You can customise this using the relativeDirPath plugin configuration option, the above example shows the posts collection going into the .
The default extension for imported documents is .json. You can customise this with the extension plugin configuration option.
The default content for the imported documents is the serialised tumblr data as JSON data. You can can customise this with the injectDocumentHelper plugin configuration option which is a function that takes in a single Document Model.
If you would like to render a partial for the tumblr data type, add a layout, and change the extension, you can this with the following plugin configuration:
extension: '.html.eco'
injectDocumentHelper: (document) ->
document.setMeta(
layout: 'default'
tags: (document.get('tags') or []).concat(['post'])
data: """
<%- @partial('post/'+@document.tumblr.type, @extend({}, @document, @document.tumblr)) %>
"""
)
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 imported tumblr documents:
<h2>Blog:</h2>
<ul><% for file in @getFilesAtPath('blog/').toJSON(): %>
<li>
<a href="<%= file.url %>"><%= file.title %></a>
</li>
<% end %></ul>
Discover the change history by heading on over to the HISTORY.md file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
Licensed under the incredibly permissive MIT license
Copyright © Bevry Pty Ltd us@bevry.me (http://bevry.me)
FAQs
Import your mongodb collections to DocPad collections
The npm package docpad-plugin-mongodb receives a total of 10 weekly downloads. As such, docpad-plugin-mongodb popularity was classified as not popular.
We found that docpad-plugin-mongodb 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.