Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gridsome-plugin-recommender
Advanced tools
Improve user´s average time on page of your Gridsome site by generating post or product recommendations to show users related content, ads or products they might be interested in on your static site.
Use machine learning to create relations in your content.
Improve user´s average time on page of your Gridsome site by generating recommendations with related content users might be interested in, such as similar posts or related products.
Analyses your posts / products or whatever entity you have and creates relations between similar data nodes based on text analysis. For more information on the text analysis part visit content-based-recommender
This plugin does not operate on the GraphQL Layer. Any content source that plugs in via GraphQL should not work with it. It only works with source plugins that operate on the Gridsome Data Store API. Tested with gridsome-source-filesystem
yarn add gridsome-plugin-recommender
npm install gridsome-plugin-recommender --save
Example: Find similar blog posts based on the title. You can find a more complex example on GitHub under /example
module.exports = {
plugins: [
{
use: '@gridsome/source-filesystem',
options: {
path: 'content/posts/**/*.md',
typeName: 'Post',
},
},
{
use: "gridsome-plugin-recommender",
options: {
enabled: true,
typeName: 'Post',
referenceTypeName: 'Tag',
field: 'title',
referenceField: 'title',
relatedFieldName: 'related',
referenceRelatedFieldName: 'related',
caseSensitive: false,
minScore: 0.01,
maxScore: 1,
minRelations:3,
maxRelations: 10,
fillWithRandom:false,
debug: false
}
}
]
};
Important notice: the plugin needs to be placed below your source plugins or otherwise no required collections are created before. Issue-1342
In your templates use something like this
<page-query>
query RelatedPosts {
allPost(filter:{id:{eq:"current-post-id"}}) {
edges {
node {
id
related{
id
path
}
}
}
}
}
</page-query>
boolean
Enables / Disables the entire plugin. This might break your UI logic as the relations will be missing from your nodes.
boolean
Enables log messages
string
requiredThe default collection we want to use to create relations of similar nodes or reference nodes.
string
requiredThe reference collection we want to use to create relations of default collection nodes.
[string]
requiredThe collection field we want to analyze for similarities
[string]
requiredThe reference collection field we want to analyze for similarities
[string]
The field attached to your GraphQl node of the default collection containing the related objects. Allows creating multiple relations per collection.
[string]
The field attached to your GraphQl node of the reference collection containing the related objects. Allows creating multiple relations per collection.
number
[0,1]Minimum score required to identify a relation between two nodes.
This might need to be adjusted depending on your content length
number
[0,1]Maximum score allowed to identify a relation between two nodes
number
Minimum relations to be produced. If the number of similar nodes is smaller than minRelations, it will be filled with random items when fillWithRandom is enabled
number
Maximum relations to be produced
boolean
Enables case-sensitive matching
boolean
Enables filling relations up to number of minRelations with random nodes
This plugin will install and configure content-based-recommender. Please refer to it in case of any problems related to the accuracy or performance issues that might occur when using large collections.
FAQs
Improve user´s average time on page of your Gridsome site by generating post or product recommendations to show users related content, ads or products they might be interested in on your static site.
The npm package gridsome-plugin-recommender receives a total of 8 weekly downloads. As such, gridsome-plugin-recommender popularity was classified as not popular.
We found that gridsome-plugin-recommender 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.