hexojs / hexo-filter-responsive-images Goto Github PK
View Code? Open in Web Editor NEWGenerate mutliple version of images for responsive Hexo blogs
License: MIT License
Generate mutliple version of images for responsive Hexo blogs
License: MIT License
I have installed this plugin and added parameters to the _config.yml but I see no additional files under the public
folder after running hexo generate
. I suspect the pattern is not correct. In the readme file, you show example patterns as:
pattern: content/**/*.+(png|jpg|jpeg)
In my Hexo install, I have a 'source' folder, not 'content.' But, specifying the following does nothing.
responsive_images:
pattern: source/**/*.+(png|jpg|jpeg)
sizes:
small:
width: 800
medium:
width: 1200
large:
width: 2000
Being able to create multiple versions of images would be fantastic. I hope we can figure this out.
Support hexo v7. This is currently the last blocker for me to upgrade my site to hexo v7.
No response
Hi, cool plugin! Correct me if I'm wrong but I believe I found a buggy behavior here. Plugin does not process images in series as intended. The problem is in file "responsive_images.js", line 39:
return route.set(...)
which is not a Bluebird promise. This leads to simultaneous processing of all the images - very resourceful. Instead one should return the Bluebird promise and resolve it after the sharp transformation is completed. Please find a code snippet below:
return new Promise(function (resolve, reject) {
var img = sharp(buffer).rotate();
var resizeOptions = getResizeOptions(hexo, config)
applySharpApiOptions(img, config).resize(config.width, config.height, resizeOptions).toBuffer().then(function (buffer) {
route.set(newPath, buffer);
resolve();
});
});
During specs run there is information about usage of deprecated methods from sharp library:
(node:78357) DeprecationWarning: embed(position) is deprecated, use resize({ fit: "contain", position }) instead
(node:78357) DeprecationWarning: ignoreAspectRatio() is deprecated, use resize({ fit: "fill" }) instead
We need to adjust the code to get rid of warnings.
Hello,
I noticed your plugin this weekend and it taught me how to use the Hexo router! I just wanted to drop a note saying that hexo-image-sizes uses the router now as well, and so should work with the other asset pipeline plugins.
Travis
Any plans to upgrade this to work with Hexo 4.0.0?
The help image_version is not found.
Hexo 6.1 was relaesed almost a year ago. I can't update to it because this plugin defines it as peer dependency with "hexo": "3.x || 4.x || 5.x"
and npm (since v7) treats such mismatch as an error.
I briefly tested this plugin with hexo 6.3 and it worked just fine.
Can we change the hexo peer-dependency version to include 6.x? What are the necessary steps? I'd be glad to submit a PR. .)
Take care!
Hello, thanks a lot for this plugin. I successfully incorporated it into my theme templates with the image_version(path {prefix: size})
helper.
Unfortunately, I can't find any information on how can I use the scaled images in the rendered post content. It would be nice to describe how one can do that in the README.
Best!
Jen
PS: If you can point me to an information on how that can be done, I can prepare a PR to extend the README with that into.
Installing this package on Mac with Apple Silicon chip fails because the specified version of sharp
does not support it.
Bumping sharp
from ^0.27.2
to ^0.28.0
fixes it.
See: lovell/sharp#2460
The Sharp library has support for a number of options in the processing. Can you provide some advice on specifying these in the config file? I am interested in 3 to start:
I would be happy to contribute to your readme file once we figure this out :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.