-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image src is wrong #47
Comments
@backurdi That's strange, but thanks for reporting it - i'll take a look at this. |
Thank you @thetre97, looking forward to hear what you find 😄 |
Sorry for not replying earlier, but this is to do with Gridsome's asset pipeline, which runs after this plugin gets data from the store - so it will only get the relative path to the image, never the transformed image. Unfortunately, I'm not sure what I can do here. |
Would it be possible to run the the plugin after the build is done? |
That's be great :) I have a hobby site (https://panzercraft.com/) that relies heavily on images. Been playign around with adding search there, but as the site is so image heavy, not being able to get the images show up when searching is a show stopper. |
I have built an app using forestry, I use the @gridsome/source-filesystem to get the data. It works fine when I just fetch the data using graphql. But when I get the data using gridsome-plugin-flexsearch then the src is wrong, it returns the src on my local machine. I think it has something to do with the src of the data.
Expected data (As returned when just fetching data with graphql)
/assets/static/uploads/content.svg?width=879&fit=cover&key=035634c
Returned data (From gridsome-plugin-flexsearch)
/Users/bachirkurdi/Documents/cyNy/uploads/content.svg
My graphql config for the data and search
{ use: "@gridsome/source-filesystem", options: { path: "blog/**/*.md", typeName: "BlogPost", resolveAbsolutePaths: true, remark: { externalLinksTarget: "_blank", externalLinksRel: ["nofollow", "noopener", "noreferrer"], }, }, }, { use: "@gridsome/source-filesystem", options: { path: "employees/**/*.md", typeName: "Employees", resolveAbsolutePaths: true, remark: { externalLinksTarget: "_blank", externalLinksRel: ["nofollow", "noopener", "noreferrer"], }, }, }, { use: "gridsome-plugin-flexsearch", options: { searchFields: ["title"], collections: [ { typeName: "BlogPost", fields: ["id", "path", "title", "excerpt", "image"], }, ], }, },
The searchResult function:
searchResults() { const searchTerm = this.searchTerm; if ( searchTerm.length > 2 && this.$search.search({ query: searchTerm, limit: 5 }).length > 0 ) { return this.$search.search({ query: searchTerm, limit: 5 }); } else { return this.$page.posts.edges; } }
Thank you a lot in advance 😄
The text was updated successfully, but these errors were encountered: