Socket
Socket
Sign inDemoInstall

assemble-helper-assets-manifest

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    assemble-helper-assets-manifest

This package provides a custom helper for Handlebars that Assemble can use.


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
6.69 kB
Created
Weekly downloads
 

Readme

Source

Assemble Helper Assets Manifest

Build Status codecov dependencies Status devDependencies Status

This package provides a custom helper for Handlebars that Assemble can use.

Installation

npm install assemble-helper-assets-manifest --save

Setup with Assemble

After you install this package, you need to tell Assemble about it. You do that by adding the package name to the helpers array in your config.

You also need to specify assetsManifest so that the helper knows where to look for your assets manifest file.

Example config

assemble: {
  options: {
    helpers: [ 'assemble-helper-assets-manifest' ],
    manifestPath: path.join(__dirname, 'manifest.json')
  }
}

Setup with Handlebars

var Handlebars = require('handlebars');
var AssetsManifestHelper = require('assemble-helper-assets-manifest');

AssetsManifestHelper.register(Handlebars, {
  manifestPath: path.join(process.cwd(), 'public', 'assets', 'manifest.json'),
  prefix: '/assets/'
});

Using the Handlebars helper

<img src="{{assetsManifest 'images/photo.jpg'}}" />
{{#each images}}
  <img src="{{assetsManifest this.src}}" />
{{/each}}

Keywords

FAQs

Last updated on 23 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc