Comments (6)
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.
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.
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.
Please look at the comment above ☝️
Cheers
from jekyll-contentful-data-import.
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.
Hey @stephthedev,
That's a WAY simpler workaround than mine 😅 !
Thanks for the good wishes!
Cheers
from jekyll-contentful-data-import.
Related Issues (20)
- SSL Error HOT 1
- Sorting when iterating HOT 3
- Liquid syntax error when accessing data objects where ID starts with a number HOT 2
- jekyll contentful data import issue HOT 1
- Locales missing in yaml file HOT 1
- environment variables HOT 3
- Documentation/Example: Jekyll collections HOT 1
- Cannot reduce resolution depth HOT 5
- Memory issues? HOT 5
- Update gemspec dependancy for rich_text_renderer HOT 1
- Localized Assets
- Unclear how to do rich_text_mappings
- Is it possible to use includes for rich-text content types? HOT 2
- No support for rich text data type? HOT 1
- Not importing drafts HOT 2
- Support for Jekyll 4.0.0 HOT 4
- Rich Text: Node Target Is Not An Asset HOT 4
- Support for importing entry snapshots
- Data strings that contain both : (colons) and ' (apostrophe) cause issues with data import
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-contentful-data-import.