metalsmith-localize-collection

0.0.1 • Public • Published

Metalsmith localize Collection

Creates localized branches of a metalsmith collection.

Installation

npm install --save metalsmith-localize-collection

Usage

var Metalsmith = require('metalsmith');
var collections = require('metalsmith-collections');
var multiLanguage = require('metalsmith-multi-language');
var localizeCollection = require('metalsmith-localize-collection');
 
Metalsmith()
  .use(multiLanguage({
    default: 'en',
    locales: ['en', 'es']
  }))
  .use(collections({
    posts: {
      pattern: 'posts/*/!(index).md',
      sortBy: 'date',
      reverse: true
    }
  }))
  .use(localizeCollection('posts'))

This will create two new collections: posts_en and posts_es

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    0

Package Sidebar

Install

npm i metalsmith-localize-collection

Weekly Downloads

0

Version

0.0.1

License

ISC

Last publish

Collaborators

  • ondrej