Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

layouts

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

layouts

Wrap templates with layouts. Layouts can be nested and optionally use other layouts.

  • 0.8.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
increased by17.16%
Maintainers
2
Weekly downloads
 
Created
Source

layouts NPM version Build Status

Wrap templates with layouts. Layouts can be nested and optionally use other layouts.

Install with npm

npm i layouts --save

Usage

var layouts = require('layouts');

Usage

var stack = {
  foo: {content: 'foo above\n{% body %}\nfoo below', layout: 'bar'},
  bar: {content: 'bar above\n{% body %}\nbar below', layout: 'baz'},
  baz: {content: 'baz above\n{% body %}\nbaz below'},
};

layouts('<div>This is content</div>', 'foo', stack);

Results in:

baz above
bar above
foo above
<div>This is content</div>
foo below
bar below
baz below

API

layouts

  • str {String}: The content string to be wrapped with a layout.
  • key {String}: The object key of the starting layout.
  • templates {Object}: Object of layouts.
  • options {Object}
    • layoutDelims {Object}: Custom delimiters to use.
    • defaultLayout {Object}: The name (key) of the default layout to use.
  • returns {String}: String wrapped with a layout or layouts.

Wrap a string with a layout, or multiple layouts.

  • template: Render templates from any engine. Make custom template types, use layouts on pages, partials or any custom template type, custom delimiters, helpers, middleware, routes, loaders, and lots more. Powers Assemble v0.6.0, Verb v0.3.0 and your application.
  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt, Less.js / lesscss.org, Topcoat, Web Experience Toolkit, and hundreds of other projects to build sites, themes, components, documentation, blogs and gh
  • verb: Verb makes it dead simple to generate markdown documentation, using simple templates, with zero configuration required. A project without documentation is like a project that doesn't exist.
  • handlebars-helpers: 120+ Handlebars helpers in ~20 categories, for Assemble, YUI, Ghost or any Handlebars project. Includes helpers like {{i18}}, {{markdown}}, {{relative}}, {{extend}}, {{moment}}, and so on.
  • template-helpers: Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Brian Woodward

License

Copyright (c) 2014-2015 Brian Woodward
Released under the MIT license


This file was generated by verb-cli on March 07, 2015.

Keywords

FAQs

Package last updated on 08 Mar 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc