# Image Minification with jekyll-assets

**URL:** <https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886>\
**Category:** Help\
**Created:** [August 20, 2020, 8:08pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886 "2020-08-20T20:08:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [August 20, 2020, 8:08pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/1 "2020-08-20T20:08:38Z")

</div>

I’ve installed the jekyll-assets gem and added the config as shown in the [README](https://github.com/envygeeks/jekyll-assets/blob/master/README.md). When I build the site, the html files are all empty. Sass is getting built and images are being copied to the \_site directory, but while the html files are getting created, they are not being passed to their layouts.

I haven’t been able to find a good tutorial for this plugin. Do you know of any?

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [August 26, 2020, 8:10pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/2 "2020-08-26T20:10:57Z")

</div>

I’ve made exactly zero headway on this. Any help would be very appreciated.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 26, 2020, 8:20pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/3 "2020-08-26T20:20:36Z")

</div>

did you try creating an issue on that repo? I’ve never used it so can’t help.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [August 26, 2020, 8:31pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/4 "2020-08-26T20:31:46Z")

</div>

I haven’t. I don’t actually have an error. I did search the existing issues to see if someone else had similar problems … no dice.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 27, 2020, 12:43am UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/5 "2020-08-27T00:43:41Z")

</div>

are you sure it is the plugin? can you try it without it?

have you tried the verbose output option when building? maybe it will show you something.

Also, why is the title of this post about image minification? seems like your problem is the html files?

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [August 27, 2020, 11:25am UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/6 "2020-08-27T11:25:21Z")

</div>

Before adding this plugin, the site was working fine. If I remove the `assets:` settings from the config file, and remove all `{% asset ... %}` calls it still builds without problem.

If I do a verbose output when the Gem is present, there is nothing that is helpful. No errors, no warnings.

As to the title of the post, you are right, my problem is about HTML files so long as I’m using the Gem. Since I am looking for `jekyll-assets` to do image minification, but can’t get it to work, it seemed appropriate.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [August 27, 2020, 12:53pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/7 "2020-08-27T12:53:30Z")

</div>

If are looking specifically at resizing images and not compressing other asset types, I have some Jekyll plugins linked here to recommend.

> **[MichaelCurrin/jekyll-resize](https://github.com/MichaelCurrin/jekyll-resize#related-projects)**
>
> Image resizing tag for Jekyll - forked to add Jekyll 4 support and docs - MichaelCurrin/jekyll-resize

The jekyll-resize plugin (or my fork) works well for what I need it to. To resize images to say 800x600 at build time and embed to them easily as images in markdown. Check the start of my readme for installation and use. Or you can try the other plugin name.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [August 27, 2020, 1:12pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/8 "2020-08-27T13:12:39Z")

</div>

Cheers Michael, but I’m specifically looking for compression/minification. I’ve already setup a test repo using some Gulp preprocessing, but just wanted to try a proof-of-concept using `jekyll-assets`. I’m open to other compression/minification utilities but wanted to give this Gem a go first.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [August 27, 2020, 2:24pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/9 "2020-08-27T14:24:49Z")

</div>

Can you share any content or configs or repo so far?

I can try this out later and post my results

---

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/brad/32/2543_2.png) [@brad](https://talk.jekyllrb.com/u/brad)\
**Post date:** [August 29, 2020, 9:48pm UTC](https://talk.jekyllrb.com/t/image-minification-with-jekyll-assets/4886/10 "2020-08-29T21:48:03Z")

</div>

The use-case has changed for the site in question so I no longer need to get this working. I may need to return to jekyll-assets one day, so it would be good for posterity to have some tutorial links here. In any event, thank you Ron and Michael for trying to help.
