🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

handlebars-extend-block

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-extend-block

add extend blocks to handlebars

1.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

handlebars-extend-block

Create extend blocks for handlebars allowing partials to inject text into parent elements. This is generally useful for script and style tags.

example

var handlebars = require('handlebars');
var extend = require('handlebars-extend-block');

handlebars = extend(handlebars);

Layout File

<head>
    <title>{{title}}</title>
    <link rel='stylesheet' href='/css/style.css'>
    {{{block "stylesheets"}}}
</head>

<body>
    {{{body}}}

    <hr/>
    post body
    <hr/>

    {{{block "scripts"}}}
</body>

Partial

{{#extend "stylesheets"}}
<link rel="stylesheet" href="/css/index.css"/>
{{/extend}}

let the magic begin

{{#extend "scripts"}}
<script>
document.write('foo bar!');
</script>
{{/extend}}

Keywords

handlebars

FAQs

Package last updated on 12 Dec 2014

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