Git Product home page Git Product logo

Comments (7)

allmarkedup avatar allmarkedup commented on May 19, 2024

This is definitely a good idea but is really plugin territory I think. You currently can't inject regular express middleware into the web plugin but if I opened that up then you could use an existing local placeholder generator lib (I'm sure there are some!) instead of re-inventing the wheel.

Actually I really like this idea - it would open up a lot of additional possibilities. I'll get on it!

from fractal.

paulrobertlloyd avatar paulrobertlloyd commented on May 19, 2024

I remember using img-placeholder (or was it node-img-placeholder) on a project last year… can’t remember how successfully. But yes, very useful when creating placeholder content for components.

from fractal.

allmarkedup avatar allmarkedup commented on May 19, 2024

I'm just tinkering with this now and it's pretty straightforward to get it up and running when using the development server. However the problem is that the static build of the site will reference the image URLs but they wouldn't exist if the server isn't running. So not useful if you want to give a static export to a client.

I'll still add in the middleware option but I'll try and think if there is anyway else that this could be done that is more compatible with the static export.

from fractal.

paulrobertlloyd avatar paulrobertlloyd commented on May 19, 2024

Ah, of course. Can you note write the placeholder images to the static folder?

from fractal.

allmarkedup avatar allmarkedup commented on May 19, 2024

Yeah possibly... but it might get complicated as the placeholder image generation is typically on-demand and so any that hadn't been requested wouldn't be in the static folder. A library that generated placeholders as data URIs in the config file would work, but would make the code view pretty verbose!

from fractal.

allmarkedup avatar allmarkedup commented on May 19, 2024

Ok this is actually way nastier that I thought. All the node placeholder image services need Cairo which has to be installed separately via brew. WIll close this for now as with the middleware support (which I've just added) users can hack this in themselves if they think it's worth the effort!

from fractal.

paulrobertlloyd avatar paulrobertlloyd commented on May 19, 2024

Cairo!

from fractal.

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.