docpad-plugin-cachr

Caches remote resources locally

npm install docpad-plugin-cachr
3 downloads in the last day
20 downloads in the last week
120 downloads in the last month

Cachr Plugin for DocPad

Build Status NPM version Flattr donate button PayPayl donate button

This DocPad plugin provides a template helper that will take in a remote URL, download it, and provide the local URL for you.

Install

npm install --save docpad-plugin-cachr

Usage

To use, simply wrap any url you want to cache locally within the exposed @cachr(url) function inside your templates.

  • Eco example:

      <img src="http://somewebsite.com/someimage.gif"/>
    

    would become:

      <img src="<%=@cachr('http://somewebsite.com/someimage.gif')%>"/>
    
  • CoffeeKup example:

      img src:'http://somewebsite.com/someimage.gif'
    

    would become:

      img src:@cachr('http://somewebsite.com/someimage.gif')
    

History

You can discover the history inside the History.md file

Contributing

You can discover the contributing instructions inside the Contributing.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2012+ Bevry Pty Ltd us@bevry.me

npm loves you