Git Product home page Git Product logo

mklueh / gridsome-plugin-recommender Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 2.0 2.41 MB

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.

Home Page: https://overflowed.dev/blog/building-a-gridsome-plugin-for-related-posts?utm_medium=github&utm_source=details

License: MIT License

JavaScript 1.39% Vue 0.21% CSS 98.39% Shell 0.01%
gridsome recommender-system recommendation-system related-posts related-articles related-items related-products similarity-detection gridsome-plugin text-analysis

gridsome-plugin-recommender's People

Contributors

dependabot[bot] avatar mklueh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

do4 jurooravec

gridsome-plugin-recommender's Issues

Component Breaks When Navigating Between Recommender Links

Hey there! First off let me say this plugin works great, I really appreciate all the work that has gone into this.

I am currently making an ecommerce shop using Gridsome, Shopify, and Sanity for a client and I am using this plugin for a recommended products component. However, I seem to be running into a bizarre issue.. For some reason whenever I click a product from the recommender component (the one using this plugin) it breaks an image carousel I am using, but when I load the page from any other path within the site or upon a page refresh the carousel works fine. I have a video attached to show what I mean (ignore the incomplete design this is a wip). Could this be because the plugin does not operate with the graphql layer? To me it appears the page does not mount correctly on the Vue side of things when navigating from a path using the recommender plugin. Unfortunately there are no console errors as well 😖

I have tested this with multiple carousel/gallery libraries (Vue Agile, Swiper, Vue Carousel, and this current one is Keen Slider) and the results are the same (breaks when navigating from a recommended link). If this is the case I may just opt out and not have a recommended product section, although its pretty damn cool lol.

Screen.Recording.2021-04-24.at.6.16.10.PM.mov

Unable to function with `gridsome-source-graphql` as a source

When I try to use the gridsome-source-graphql source, the recommender plugin cannot find the specified option.typeName

The error message I receive is:

Gridsome v0.7.20

Initializing plugins...
gridsome-plugin-recommender: options.typeName 'craft' cannot be found - make sure the collection exists

I am using CraftCMS as a GraphQL data source. When I try to switch to the source-filesystem such as your example, then it does work, so I believe it's related to the async nature of retrieving the graphql data source and it not being loaded while the recommender loads in.

Here is an excerpt from my gridsome.config.js file which does not work.

  plugins: [
    {
      use: '@gridsome/source-graphql',
      options: {
        url: process.env.CRAFT_API_URL,
        fieldName: 'craft',
        typeName: 'craft',
        headers: {
          Authorization: `Bearer ${process.env.CRAFT_API_TOKEN}`,
        }
      }
    },
    {
      use: "gridsome-plugin-recommender",
      options: {
        enabled: true,
        typeName: 'craft',
        field: 'mainContent',
        relatedFieldName: 'related',
        minScore: 0.01,
        maxScore: 1,
        minRelations:3,
        maxRelations: 10,
        fillWithRandom:false,
        debug: false
      }
    },

@gridsome/vue-remark support

As per the documentation in the readme, the plugin should work with @gridsome/vue-remark as a source, but I have been doing some attempts to make it work and get the following error:

Initializing plugins...
gridsome-plugin-recommender:  training 4
gridsome-plugin-recommender:  Fetching relations for document 376f652e3a2f627f81710842c9d44ee3
TypeError: expected input to be a string or buffer

Could an example on how to configure the plugin to work with vue-remark be provided?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.