Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Created March 14, 2012 16:15
Show Gist options
  • Save mikermcneil/2037586 to your computer and use it in GitHub Desktop.
Save mikermcneil/2037586 to your computer and use it in GitHub Desktop.
Grails: find css/js URLs and replace them with ${resource} URLs
For <script> tags:
-------------------
Find:
src="js/(\S+)">
Replace:
src="\${resource(dir:'js',file:'$1')}">
For <link> tags:
-------------------
Find:
href="css/(\S+)"/>
Replace:
href="\${resource(dir:'css',file:'$1')}"/>
@mikermcneil
Copy link
Author

Modify as necessary, my tags looked like:

<link ..... href="css/xxxxxxxx"/>

and

<script ....... src="js/xxxxxxxx"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment