Giter Site home page Giter Site logo

hexo-filter-responsive-images's People

Contributors

curbengh avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ertrzyiks avatar fredericosilva avatar goodhoko avatar jamealg avatar stevenjoezhang avatar tomap avatar uiolee avatar yoshinorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexo-filter-responsive-images's Issues

hexo-image-sizes uses the router now

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

Support for hexo v7

Check List

  • I have already read README.
  • I have already searched existing issues.
  • I have already searched existing pull requrests.

Feature Request

Support hexo v7. This is currently the last blocker for me to upgrade my site to hexo v7.

Additional context

No response

Add Hexo 6.x to peer dependencies.

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!

Fix deprecation notices

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.

Setting Options

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 :)

  • phi

How to use scaled images in rendered post content?

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.

Filter not processing in Series

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(newPath, resizeImageFn(hexo, buffer, sizeSets[name]))

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();
  });
});

How to specify pattern string in config?

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.

  • phi

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.