carlcs/craft-revmanifest

There is no license information available for the latest version (v1.0.2) of this package.

Rev Manifest plugin for Craft CMS

Installs: 30

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Type:craft-plugin

v1.0.2 2016-02-02 18:23 UTC

This package is auto-updated.

Last update: 2024-04-20 03:58:11 UTC


README

A Craft plugin to look up a static asset's filename in an asset revisioning manifest like the one gulp-rev outputs.

Installation

To install the plugin, copy the revmanifest/ folder into craft/plugins/. Then go to Settings → Plugins and click the "Install" button next to "Rev Manifest".

Twig function

revUrl( assetPath )

Looks up an asset path in the manifest and returns the asset revision's URL.

{{ revUrl('assets/stylesheets/app.css') }}

{# outputs assets/stylesheets/app-a930f9af02.css #}

If the asset path is not present in the manifest it will return the URL for the original asset.

The asset revision's path will be appended to your Site URL. Set the Site URL in Craft's config settings and Craft doesn't have to fetch it from the database.

Parameters

assetPath : The original asset path.

Settings

You can set the path to your manifest file in Craft's config settings. Without configuration, the plugins expects the manifest file in assets/rev-manifest.json.

'revManifestPath' => 'rev-manifest.json'