Socket
Socket
Sign inDemoInstall

eleventy-plugin-related

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eleventy-plugin-related

Find related documents in eleventy.


Version published
Weekly downloads
133
increased by43.01%
Maintainers
1
Weekly downloads
 
Created
Source

npm Build Release Docs

Description

Filter and/or short code to rank text documents by similarity.

Install

Install using NPM or similar.

npm i eleventy-plugin-related

Usage

eleventyConfig.addFilter(
  "related",
  require("eleventy-plugin-related").related({
    serializer: (doc) => [doc.title, doc.link ?? "", doc.text ?? ""],
    weights: [10, 1, 3],
  })
);

Usage in a NunJucks template would look similar to the following.

<h3>Related</h3>
<ul>
  {% for result in story | related(stories) %}
  <li>{{ result.relative }} - {{ result.document.title }}</li>
  {% endfor %}
</ul>

For more complex options, check out the package related-documents, on which this package is based.

Keywords

FAQs

Package last updated on 28 Nov 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc