Coder Social home page Coder Social logo

harrego / jekyll-asset-post-processor Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 36 KB

Process then suffix your Jekyll assets with cache busting version hashes

Home Page: https://rubygems.org/gems/jekyll-asset-post-processor

License: MIT License

Ruby 100.00%
asset-pipeline cache-busting jekyll ruby

jekyll-asset-post-processor's People

Contributors

colinbarry avatar harrego avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

colinbarry

jekyll-asset-post-processor's Issues

Problem with filters (i.e. `relative_url`)

Thanks for creating this @harrego, it was exactly what i was looking for to optimize a pet project of mine โ€“ it's so great to find a Jekyll plugins that has such a recent commit history, those are hard to come by these days...

However, i'm having trouble updating my codebase with it, as basically all my linked links use the relative_url filter to allow deploying to a subpath on github to preview via github pages.

When i update a current code snippet like this:

<link rel="preload" as="style" href="{{ "/assets/css/fontawesome-all.min.css" | relative_url }}" />

to this:

<link rel="preload" as="style" href="{% process_asset "assets/css/fontawesome-all.min.css" | relative_url %}" />

the build process fails with:

Liquid Exception: No such file or directory @ rb_file_s_mtime - "assets/css/fontawesome-all.min.css" | relative_url in ~/prog/b3f/stadtwerk-mit-zukunft/_layouts/default.html
             Error: No such file or directory @ rb_file_s_mtime - "assets/css/fontawesome-all.min.css" | relative_url
             Error: Run jekyll build --trace for more information.

The tag can be used in any HTML or Sass file and even supports Liquid variables, filters, and tags

Maybe i'm doing something wrong here? Kindly advise in that case. I feel like i tried all possible combinations already to no avail.


<link rel="preload" as="style" href="{% process_asset "assets/css/fontawesome-all.min.css" %}" />

Works fine, rendering the expected

<link rel="preload" as="style" href="/assets/css/fontawesome-all.min-3e7031c99ff382f5f2fbd6a10069e266.css" />

so jekyll-asset-post-processor is installed correctly and working fine โ€“ except it is not usable for me as this file cannot be found when a baseurl is set.

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.