Giter Site home page Giter Site logo

hugo-module-tnd-imgix's People

Contributors

regisphilibert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hugo-module-tnd-imgix's Issues

Add snippets to mapping configuration

We beed a decent UX before considering this


For now we can map keywords to certain parameter.

width: w.

This is cool, but some complex combination of key/value pairs are often used. For example you could often add a facedetection settings which require two params:

fit=facearea&facepad=6

Adding the following shortcode to the mapping config:

imgix:
  mapping:
    width: w
    face:
      fit: facearea
      facepad: 6

Would allow user to call given shortcodes:

{{ $src := partial "tnd-imgix/GetSrc (dict "src" $src" "width" 500 "snippets" (slice "face") }}

Prep for Open Source promotion

The module will soon be featured in Blog Post and should be appraised for the job.

  • Review documentation
  • Review UX/Naming
  • Look for improvements.
  • Rename to hugo-module-tnd-imgix

Optimize for GIFs

Note that currently GIFs are only enabled for ndbooks.com

Since Gifs are an edge case, if we make changes I'd prefer it not be one that could impact build times.

Sourced from: https://github.com/theNewDynamic/ndbooks.com/issues/162

Gifs solved by Imgix, but we may need to make some adjustments.

Anyways, I've enabled GIFs for your source. It'll take 10-15 minutes for them to re-deploy, but your GIFs should work after that- if they don't, you can use our purge tool to clear the GIFs from our cache, which will fix the issue.

Before you start using GIFs, it's important that you read the information below. Since GIFs are much larger than standard images and can have a much larger impact on your billing overall, I wanted to give you a little more info to ensure the success of the GIFs. The most important thing to do is use auto=format,compress for the animated GIFs. It will actually turn those GIFs into an animated WebP in supported browsers (such as Chrome).

We do not recommend the transformation of extremely large GIFs, extremely long GIFs, or any upscaling of GIFs. Transforming long or heavy GIFs is an extremely time-intensive process that can cause your image rendering to drastically slow down.

Every other parameter is the same except for the quality parameter. Since GIFs operate in such a different way from images, we created a new parameter called gif-q. I would suggest gif-q=35 to gif-q=60. The higher the number, the more compression applied to the GIF.

Just to show you the difference:

This one is 624 KB in Chrome: http://tom.imgix.net/dogmilk.gif?frame=60-130&w=300&h=200&auto=format,compress&gif-q=35

This one without those parameters is 1.7 MB: http://tom.imgix.net/dogmilk.gif?frame=60-130&w=300&h=200

Also, if you wanted to make a larger change (but certainly would require more front end work) you could convert the GIF to an MP4 and use some video tags to make it look like a GIF (

Here is a CodePen example of what I am talking about: https://codepen.io/daletom/pen/EQoazB

For more information regarding GIF parameters, you can read through our documentation below:
https://docs.imgix.com/apis/url/animation

One final note - It's best to not compress your GIFs before serving them with imgix. Since we optimize images, uploading a pre-compressed GIF can have the opposite effect, which can degrade the quality and increase the GIF's file size.

Module Doesn't Render Image

Hello - not sure if this module is still being maintained - nothing seems to render after installation and configuration.

Check SRC url before applying imgix logic

It should be safe to call the GetImgixSRC function with a string pointing to an external image not hosted on imgix. (Some projects might let user either add a relative image which will be pulled from imgix, or an absolute image src from anywhere.

GetSRC/GetImgixSRC should therefor test the url before running their logic.

If argument is string, we should use default transformation

Currently if user does not have any transformation to apply to an image, they can pass a string as argument:

{{ $image := partial "imgix/GetImageSRC" "/image.jpg" }}

instead of a dict

{{ $image := partial "imgix/GetImageSRC" (dict "src" "/image.jpg" "width" 500") }}

Question Task is, when a string is passed, should we assume the user needs the "default" transformation set in the site config:

imgix:
  domain: tnd-backpackers.imgix.net
  defaults:
    auto: format
    ch: Width,DPR
    q: 95

Or should we assume they don't need any transformation at all.

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.