docpad-plugin-related

Adds support for related documents to DocPad

Usage no npm install needed!

<script type="module">
  import docpadPluginRelated from 'https://cdn.skypack.dev/docpad-plugin-related';
</script>

README

Related Plugin for DocPad

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Adds support for related documents to DocPad

Usage

Add a tags array to your document meta (in the header). Example :

documents/dog.html.md

---
title: My blog post about dogs
tags:
  - animal
---

documents/cat.html.md

---
title: My blog post about cats
tags:
  - animal
---

Both posts will be related through the animal tag. In the template.

To output the related documents, use the getRelatedDocuments(document?) collection helper like so using eco.

<% for document in @getRelatedDocuments(): %>
    <a href="<%= document.url %>"><%= document.title %></a><br/>
<% end %>

Configuration

  • parentCollectionName defaults to html - use to specify the collection we should scan for related documents

Install

Install this DocPad plugin by entering docpad install related into your terminal.

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under: