Giter VIP home page Giter VIP logo

Comments (6)

dlitvakb avatar dlitvakb commented on July 28, 2024

Hey @stephthedev,

With the current state of the gem, it's only possible to retrieve assets that are linked to entries.

If you provide me with more details, maybe we can see if there's a way to work around your issue, or if we need to add functionality to retrieve all assets as an optional behaviour.

Cheers

from jekyll-contentful-data-import.

stephthedev avatar stephthedev commented on July 28, 2024

Howdy!

I'm looking to retrieve a list of all assets in a space as a jekyll data yaml file. Then, I'd like to loop through the data file and generate an image tag using its thumbnail (via the image api) and also include a link to the image for further viewing.

I know I can use the contentful.rb api, but the jekyll-contentful-data-import api would save me a step by avoiding creating the yaml file on my end.

Thanks again :-)

p.s. The jekyll-contentful-data-import api is fantastic!

from jekyll-contentful-data-import.

dlitvakb avatar dlitvakb commented on July 28, 2024

Hey @stephthedev,

This looks definitely something that is not possible at the moment with this tool.

I'll add it to my feature backlog, sadly, I cannot promise it will get implemented any time soon, as I'm about to have a baby and I have parental leave until February.

But I'll try to add it before that time, if this happens, I'll let you know.

If you're willing to help implementing it, it would be awesome.

Cheers

EDIT: I think I thought of a super complex, but possible way of getting this done with the current gem.

What you can do is create a custom mapper that only maps assets, make sure you go as many levels deep as you need. Then use the individual entry files option and the all entries option.

This will fetch all assets that you have a relationship with, indexed by entry. You can even manipulate the results in the mapper a little bit, so that it returns a flat structure instead of a nested structure with the field names. Then, you can even inline the Images API call in the mapper.

It's definitely not a perfect solution, as it requires all your assets to be related to something, and then the usage will be indexed by entry. BUT, it's something that's totally doable right now.

from jekyll-contentful-data-import.

dlitvakb avatar dlitvakb commented on July 28, 2024

Please look at the comment above ☝️

Cheers

from jekyll-contentful-data-import.

stephthedev avatar stephthedev commented on July 28, 2024

Hey @dlitvakb

First things first, congrats on the new baby! Hope the baby is happy and healthy!

I've actually figured out a (cheap) workaround using the contentful.rb gem. So far I only have 1 asset, so I'm not sure how well this will perform when I have about 50+ or so. There's some amount of hard-coding, but it works for now.

Your idea sounds like another viable workaround. Unfortunately, not all of my assets will be tied to content (this might change in the future). Right now, I'm using Contentful as a:

  • CMS - for adding blog posts
  • CDN - for showcasing Editor created photographs; for powerful on-the-fly image processing

Regardless, thanks for the speedy replies and brainstorming with me.
Good luck with the baby!

from jekyll-contentful-data-import.

dlitvakb avatar dlitvakb commented on July 28, 2024

Hey @stephthedev,

That's a WAY simpler workaround than mine 😅 !

Thanks for the good wishes!

Cheers

from jekyll-contentful-data-import.

Related Issues (20)

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.