Socket
Socket
Sign inDemoInstall

metalsmith-partial

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

metalsmith-partial

A metalsmith plugin to provide a 'partial' helper.


Version published
Maintainers
1
Created
Source

metalsmith-partial

A metalsmith plugin for a partial

This plugin provide 'partial' helper to include other templates. You can use any templating engine supported by consolidate.js.

Installation

$ npm install metalsmith-partial

Example

Source file src/index.html:

---
title: The title
---
<p>The contents</p>

{%- @partial('foobar.html') %}

Partial partials/foobar.html:

<p>This is a partial.</p>

Build file build.js:

var metalsmith = require('metalsmith');
var partial = require('metalsmith-partial');
var templates = require('metalsmith-templates');

metalsmith(__dirname)
  .source('./src')
  .destination('./dest')
  .use(partial({
    directory: './partials', 
    engine: 'eco'
  }))
  .use(templates({
    engine: 'eco',
    inPlace: true
  }))
  .build();

Results in dist/index.html:

<p>The contents</p>

<p>This is a partial</p>

License

MIT

FAQs

Package last updated on 11 Jan 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