{"id":23924484,"url":"https://github.com/mklueh/gridsome-plugin-recommender","last_synced_at":"2025-04-12T02:26:12.605Z","repository":{"id":39022199,"uuid":"295112956","full_name":"mklueh/gridsome-plugin-recommender","owner":"mklueh","description":"Improve user´s average time on page of your Gridsome site by automatically finding related posts or products. Uses machine learning to determine recommendations of all kind, be it other posts, context-related ads, related products in your shop, affiliate products and more.","archived":false,"fork":false,"pushed_at":"2022-12-13T14:43:34.000Z","size":2464,"stargazers_count":13,"open_issues_count":24,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T02:25:57.821Z","etag":null,"topics":["affiliate","graphql","gridsome","gridsome-plugin","machine-learning","recommendation-system","recommender-system","related-articles","related-items","related-posts","related-products","shop","shopify","similarity-detection","text-analysis"],"latest_commit_sha":null,"homepage":"https://overflowed.dev/blog/building-a-gridsome-plugin-for-related-posts?utm_medium=github\u0026utm_source=details","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mklueh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-13T08:51:49.000Z","updated_at":"2024-12-01T08:50:11.000Z","dependencies_parsed_at":"2023-01-28T13:03:15.585Z","dependency_job_id":null,"html_url":"https://github.com/mklueh/gridsome-plugin-recommender","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklueh%2Fgridsome-plugin-recommender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklueh%2Fgridsome-plugin-recommender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklueh%2Fgridsome-plugin-recommender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mklueh%2Fgridsome-plugin-recommender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mklueh","download_url":"https://codeload.github.com/mklueh/gridsome-plugin-recommender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506500,"owners_count":21115441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["affiliate","graphql","gridsome","gridsome-plugin","machine-learning","recommendation-system","recommender-system","related-articles","related-items","related-posts","related-products","shop","shopify","similarity-detection","text-analysis"],"created_at":"2025-01-05T19:13:36.056Z","updated_at":"2025-04-12T02:26:12.583Z","avatar_url":"https://github.com/mklueh.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Gridsome Recommender Plugin\n\n[![npm](https://img.shields.io/npm/v/gridsome-plugin-recommender.svg)](https://www.npmjs.com/package/gridsome-plugin-recommender)\n\nUse machine learning to create relations in your content.\n\nImprove user´s average time on page of your [Gridsome](https://gridsome.org/) site by generating recommendations with related content users might be interested in, such as similar posts or related products.\n\n\nAnalyses 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](https://github.com/stanleyfok/content-based-recommender)\n\n \n## Common Use Cases\n\n1. Find related posts and recommend similar posts to users\n2. Show related products the user might also be interested in in your shop\n3. Save time by automatically tagging / categorizing your posts with related tags\n4. Showing context-based ads / affiliate links on your post pages that relate to the content\n5. Automatically generating tag / category indexes for your posts or products \n \n## Examples\n\n### See Post-Recommendations and Contextual-Ads in action [on my site](https://www.overflowed.dev)\n### See Post-Recommendations and Auto-Tagging in action [on the demo site](https://mklueh.github.io/gridsome-plugin-recommender/) with [source code](https://github.com/mklueh/gridsome-plugin-recommender/tree/master/example)\n\n![Showcase](images/gridsome_recommender_showcase.png)\n\n\n## Restrictions\n\n**This plugin does not operate on the GraphQL Layer. Any content source that plugs in via GraphQL should not work with it. \nIt only works with source plugins that operate on the [Gridsome Data Store API](https://gridsome.org/docs/data-store-api/).\nTested with [gridsome-source-filesystem](https://gridsome.org/plugins/@gridsome/source-filesystem)**\n\n\n## Install\n\n- `yarn add gridsome-plugin-recommender`\n- `npm install gridsome-plugin-recommender --save`\n\n## Getting Started\n\nExample: Find similar blog posts based on the title. You can find a more complex example on GitHub under /example\n\n```js\nmodule.exports = {\n  plugins: [\n    {\n      use: '@gridsome/source-filesystem',\n      options: {\n        path: 'content/posts/**/*.md',\n        typeName: 'Post',\n      },\n    },\n    {\n      use: \"gridsome-plugin-recommender\",\n      options: {\n        enabled: true,\n        typeName: 'Post',\n        referenceTypeName: 'Tag',\n        field: 'title',\n        referenceField: 'title',\n        relatedFieldName: 'related',\n        referenceRelatedFieldName: 'related',\n        caseSensitive: false,\n        minScore: 0.01,\n        maxScore: 1,\n        minRelations:3,\n        maxRelations: 10,\n        fillWithRandom:false,\n        debug: false\n      }\n    }\n  ]\n};\n```\n\n**Important notice: the plugin needs to be placed below your source plugins or otherwise no required collections are created before. \n[Issue-1342](https://github.com/gridsome/gridsome/issues/1342)**\n\n\nIn your **templates** use something like this\n\n```\n\u003cpage-query\u003e\n    query RelatedPosts {\n      allPost(filter:{id:{eq:\"current-post-id\"}}) {\n        edges {\n          node {\n            id\n            related{\n              id\n              path\n            }\n          }\n        }\n      }\n    }\n\u003c/page-query\u003e\n```\n\n\n\n\n## Options\n\n#### enabled\n\n- Type: `boolean`\n\nEnables / Disables the entire plugin. This might break your UI logic as the relations will be missing from\nyour nodes.\n\n#### debug\n\n- Type: `boolean`\n\nEnables log messages\n\n#### typeName\n\n- Type: `string` _required_\n\nThe default collection we want to use to create relations of similar nodes or reference nodes.\n\n#### referenceTypeName\n\n- Type: `string` _required_\n\nThe reference collection we want to use to create relations of default collection nodes.\n\n#### field\n\n- Type: `[string]` _required_\n\nThe collection field we want to analyze for similarities\n\n#### referenceField\n\n- Type: `[string]` _required_\n\nThe reference collection field we want to analyze for similarities\n\n#### relatedFieldName\n\n- Type: `[string]`\n- Default: related\n\nThe field attached to your GraphQl node of the default collection containing the related objects.\nAllows creating multiple relations per collection.\n\n#### referenceRelatedFieldName\n\n- Type: `[string]`\n- Default: related\n\nThe field attached to your GraphQl node of the reference collection containing the related objects.\nAllows creating multiple relations per collection.\n\n#### minScore\n\n- Type: `number` [0,1]\n- Default: 0.01\n\nMinimum score required to identify a relation between two nodes.\n\n**This might need to be adjusted depending on your content length**\n\n\n#### maxScore\n\n- Type: `number` [0,1]\n- Default: 1\n\nMaximum score allowed to identify a relation between two nodes\n\n#### minRelations\n\n- Type: `number`\n- Default: 3\n\nMinimum relations to be produced. If the number of similar nodes is smaller than minRelations,\nit will be filled with random items when fillWithRandom is enabled\n\n#### maxRelations\n\n- Type: `number`\n- Default: 10\n\nMaximum relations to be produced\n\n#### caseSensitive\n\n- Type: `boolean`\n- Default: false\n\nEnables case-sensitive matching\n\n#### fillWithRandom\n\n- Type: `boolean`\n- Default: false\n\nEnables filling relations up to number of minRelations with random nodes\n\n## Usage\n\nThis plugin will install and configure [content-based-recommender](https://github.com/stanleyfok/content-based-recommender).\nPlease refer to it in case of any problems related to the accuracy or performance issues that might occur when using\nlarge collections. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmklueh%2Fgridsome-plugin-recommender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmklueh%2Fgridsome-plugin-recommender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmklueh%2Fgridsome-plugin-recommender/lists"}