Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active December 22, 2015 00:49
Show Gist options
  • Save stevewithington/6392020 to your computer and use it in GitHub Desktop.
Save stevewithington/6392020 to your computer and use it in GitHub Desktop.
Mura CMS : You don't have to rely on Mura's $.static() method ... you can create your own reference to CFStatic.
<cfscript>
// drop this in your eventHandler.cfc's onSiteRequestStart() method
var themeAssetPath = arguments.$.siteConfig('themeAssetPath');
arguments.$.cfStatic = new requirements.org.cfstatic.CfStatic(
staticDirectory = ExpandPath('#themeAssetPath#')
, outputDirectory = 'compiled'
, staticURL = '#themeAssetPath#/'
, minifyMode = 'package'
, checkForUpdates = !arguments.$.siteConfig('cache')
);
</cfscript>
<!--- then, wherever you want to render any includes files, you could use the following syntax --->
<cfoutput>
#$.cfStatic.include('/css/yourpackage/').renderIncludes('css')#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment