Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
davydotcom committed Jun 3, 2016
1 parent 920d124 commit bea05b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion asset-pipeline-docs/src/asciidoc/concepts.adoc
Expand Up @@ -118,4 +118,14 @@ This relative url replacement is really handy because any external css library t

TIP: HTML files automatically get relative url replacement making it easy to generate 100% static websites without any need for a dynamic templating engine.

Currently javascript is not scanned for relative path replacement. It is common practice to create a base path variable if required in the html that includes your javascript if your javascript indeed needs to reference images or documents in the asset-pipeline.
Currently javascript is not scanned for relative path replacement. It is now possible to reference assets from your javascript using a precompiler directive in your code called `asset_url`. It is not relative and always produces an absolute path response which can be configured via the `mapping` config option which defaults to 'assets':

[source,javascript]
---
var logo = asset_url('grails_logo.png');

// will get replaced at build time with :
// var logo = '/assets/grails_logo-adcv456.png';
---

NOTE: This method is not evaluated in javascript but rather replaced like a precompiler directive.
2 changes: 2 additions & 0 deletions asset-pipeline-docs/src/asciidoc/introduction.adoc
Expand Up @@ -7,6 +7,8 @@ This guide documents configuration and usage examples of the asset-pipeline plug

=== Release History

* June 3, 2016
** 2.10.0 Release - Adds asset_url() method to javascript processing for resolving assets with properly digested names within your javascript files. See Concepts section on Relative Urls.
* May 24, 2016
** 2.9.1 Release - Fixes asset resolution issues with libsass in sass-asset-pipeline
* May 23, 2016
Expand Down

0 comments on commit bea05b9

Please sign in to comment.