Giter VIP home page Giter VIP logo

gridsome-starter-strapi's Introduction

Hi there ๐Ÿ‘‹

gridsome-starter-strapi's People

Contributors

dependabot[bot] avatar lukaskoeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

doc22940

gridsome-starter-strapi's Issues

Missing Information

This is just to document what issues I ran into and how I resolved them.

They may not affect everyone who uses this repo, but it may be something that could be quickly fixed to avoid anyone else having the same problems.

First Issue

I was unable to build a GraphQL query using the provided statement in the gridsome.server.js file. I looked at the troubleshooting portion in the readme but that didn't solve the problem.

Solution

I found the problem was in the options supplied to the source-strapi plugin. I added fieldName: "strapi" and typeName: "strapi" and the query started to work.

  siteName: "Gridsome-Starter-Strapi",
  plugins: [
    {
      use: "@gridsome/source-strapi",
      options: {
        apiURL: "http://localhost:1337",
        fieldName: "strapi",
        typeName: "strapi",
        queryLimit: 1000, // Defaults to 100
        contentTypes: ["post"],
        singleTypes: ["about"],
        // Possibility to login with a Strapi user,
        // when content types are not publicly available (optional).
        loginData: {
          identifier: "",
          password: "",
        },
      },
    },
    {
      use: "@gridsome/transformer-remark",
    },
  ],
};

Second Issue

During the build step I kept getting hung up in gridsome.server.js again because of the process of saving the images from Strapi in the src/assets/images folder.

Solution

When I cloned the repo there was no assets/images folder in the project and the function was not creating the necessary directories to save the image file in. I manually created the directory structure and started the process again with no issue.

Q: Save new images to Gridsome when server is running

Hi,

I have implemented your function to move all medias from Strapi into Gridsome's asset directory, so that all feature of the g-image can be used. And that works very well. I have encountered one problem though. If my server is running and I upload a new image in Strapi, then there is no chance that this image will be moved to assets directory. The server must be restarted.

Is there any way to do that while the server is running? I'm looking for some solution, which would work on production as well. Right know it seems that to make it working, the whole g-image functionality needs to be implemented in some custom component, which would then use responsive image variants that Strapi creates for every image.

Converting rich text to html

Could the rich text section be converted to HTML instead of with white-space: pre-line to allow for more customisation around paragraphs?

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.