Cacofonix
Cacofonix

Reputation: 465

Why images folder is not copied when generating an Octopress with jekyll-assets blog?

I am building an Octopress blog and I am implementing an alternative search implementation, lunr-search.

This requires an asset pipeline implementation for Jekyll.

My assets, javascripts and CSSs are compiled and combined correctly, but my images folder is not copied to the public folder.

EDIT with further info:

I have my assets under /source/_assets/javascripts, /source/_assets/stylesheets and /source/_assets/images.

The relevant part in _config.yml:

assets:
  dirname: assets
  baseurl: /assets/
  sources:
    - _assets/javascripts
    - _assets/jwplayer
    - _assets/stylesheets
    - _assets/images
  compress:
    js:
    css:
  cachebust: hard
  gzip: [ text/css, application/javascript ]

My compiled and combined assets are generated as expected under /public/assets, under which I can find the app.js and screen.css, however there is no images folder.

Thanks!!

Upvotes: 1

Views: 2488

Answers (2)

Adrian
Adrian

Reputation: 9600

This did the trick for me

{% img /images/logo.png %}

Upvotes: 1

Andrew Merenbach
Andrew Merenbach

Reputation: 56

Have you rewritten your source to use Jekyll-Assets to render image paths? In my experience, Jekyll-Assets needs to know you'll be using an asset before it will copy it to the output directory. It will know when you use a corresponding Liquid tag or filter.

According to the Jekyll-Assets readme, URLs for assets that are neither scripts nor stylesheets may be included with the following Liquid tag:

{% asset_path logo.png %}

Additionally, the following Liquid filter is available:

{{ 'logo.png' | asset_path }}: Returns resulting URL for logo.png

Both examples come from the URL above. So in this case the following two lines would be equivalent:

<img src="{% asset_path logo.png %}" alt="Logo">
<img src="{{ 'logo.png' | asset_path }}" alt="Logo">

If you are indeed already doing this, relevant HTML/Liquid source code may prove helpful.

Upvotes: 3

Related Questions