Skip to content

bendera/handlebars-helper-placeholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

handlebars-helper-placeholder

Handlebars helper which generate an inline placeholder svg.

Usage example

<img src="{{placeholder width='100' height='100'}}" width="100" height="100" alt="example image">

Options

  • width Image width. Default: 100%
  • height Image height. Default: 100%
  • bg Background color. Default: #dddddd
  • fg Foreground color. Default: #ffffff
  • font Font family. Dfeault: sans-serif
  • size Font size. Default: 14px
  • weight Font weight. Default: bold
  • text Custom text. Default: [width]x[height]

Installation

npm install handlebars-helper-placeholder --save

Usage with Fractal

const placeholder = require('handlebars-helper-placeholder');

const hbs = require('@frctl/handlebars')({
    helpers: {
        placeholder: placeholder
    }
});

fractal.components.engine(hbs);
fractal.docs.engine(hbs);

Usage with Assemble

Coming soon...