Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Handlebars Template Engine for Brick.js.
demo/
directory contains a demo project. Run the demo:
git clone git@github.com:brick-js/brick-hbs.git
cd brick-hbs && npm install
cd demo && npm install
grunt
Open http://localhost:3000 in your browser!
npm install -S brick-hbs
var brickJs = require('brick.js');
var Hbs = require('brick-hbs');
var brk = brickJs();
var hbs = Hbs.brick({
cache: false // disabled by default, see below
})
brk.engine('.hbs', hbs); // set hbs engine for .hbs file
brk.engine('.html', hbs); // set hbs engine for .html file
app.use('/', brk.express);
In Brick.js, partials are organized as modules. Eg:
File footer/view.hbs
in module footer
:
<footer> Powered by Brick.js </footer>
File home/view.hbs
in module home
:
<html>
<body>
<p>Demo Page</p>
{{include 'footer'}}
</body>
</html>
The HTML for home
page will be rendered as:
<html>
<body>
<p>Demo Page</p>
<footer> Powered by Brick.js </footer>
</body>
</html>
Brick-hbs implemented async helper internaly, to support layout extend. Eg:
File layout1/view.html
in module layout1
:
<html>
<title>Common Title</title>
<body>
{{{block}}}
</body>
</html>
Use
{{block}}
for escaping.
File home/view.hbs
in module home
:
{{extend 'layout1'}}
<p> Contents for home page </p>
The HTML for home
page will be rendered as:
<html>
<title>Common Title</title>
<body>
<p> Contents for home page </p>
</body>
</html>
Type: Bool
Default: false
If set to true
, all templates will be loaded only once (for production usage). Otherwise, template file will be reloaded on every HTTP request.
Above declared Hbs
object is compatible with Handlebars.
Javascript:
Hbs.registerHelper('upperCase', function(content) {
return content.toUpperCase();
});
Template:
<h3>{{upperCase 'alice'}}</h3>
Will be rendered as:
<h3>ALICE</h3>
FAQs
Handlebars Template Engine for Brick.js
We found that brick-hbs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.