<commit_before>#!/usr/bin/env node

'use strict'

const path = require('path')
const Metalsmith = require('metalsmith')
const layouts = require('metalsmith-layouts')
const markdown = require('metalsmith-markdown')
const permalinks = require('metalsmith-permalinks')
const metalsmithPrism = require('metalsmith-prism')
const collections = require('metalsmith-collections')
const feed = require('metalsmith-feed')
const mapHandlebarsPartials = require('../scripts/mapHandlebarsPartials')
const siteInfo = require('../siteInfo')
const ncp = require('ncp')
const dir = path.join(__dirname, '..')

function build (done) {
  const metalsmith = Metalsmith(dir)

  metalsmith.metadata({
    site: siteInfo
  })

  metalsmith
    .source(path.join(dir, 'content'))
    .use(collections({
      blog: {
        pattern: 'blog/**/*.md',
        sortBy: 'date',
        reverse: true,
        refer: false
      }
    }))
    .use(feed({
      collection: 'blog'
    }))
    .use(markdown({
      langPrefix: 'language-'
    }))
    .use(metalsmithPrism())
    .use(permalinks({
      relative: false
    }))
    .use(layouts({
      engine: 'handlebars',
      pattern: '**/*.html',
      partials: mapHandlebarsPartials(metalsmith, 'layouts', 'partials'),
      helpers: {
        excerpt: require('../scripts/helpers/excerpt'),
        moment: require('../scripts/helpers/moment')
      }
    }))
    .destination(path.join(dir, 'dist'))

  metalsmith.build(err => {
    if (err) {
      throw err<commit_msg>feat: Tell generator to look for data and pass it to us.<commit_after>#!/usr/bin/env node

'use strict'

const path = require('path')
const Metalsmith = require('metalsmith')
const layouts = require('metalsmith-layouts')
const markdown = require('metalsmith-markdown')
const permalinks = require('metalsmith-permalinks')
const metalsmithPrism = require('metalsmith-prism')
const collections = require('metalsmith-collections')
const feed = require('metalsmith-feed')
const mapHandlebarsPartials = require('../scripts/mapHandlebarsPartials')
const siteInfo = require('../siteInfo')
const ncp = require('ncp')
const dir = path.join(__dirname, '..')

function build (done) {
  const metalsmith = Metalsmith(dir)

  metalsmith.metadata({
    site: siteInfo
  })

  metalsmith
    .source(path.join(dir, 'content'))
    .use(collections({
      blog: {
        pattern: 'blog/**/*.md',
        sortBy: 'date',
        reverse: true,
        refer: false
      },
      conferences: {
        pattern: 'conferences/**/*.md',
        sortBy: 'rating',
        reverse: true
      }
    }))
    .use(feed({
      collection: 'blog'
    }))
    .use(markdown({
      langPrefix: 'language-'
    }))
    .use(metalsmithPrism())
    .use(permalinks({
      relative: false
    }))
    .use(layouts({
      engine: 'handlebars',
      pattern: '**/*.html',
      partials: mapHandlebarsPartials(metalsmith, 'layouts', 'partials'),
      helpers: {
        modul: require('../scripts/helpers/modul'),
        or: require('../scripts/helpers/or'),
        excerpt: require('../scripts/helpers/excerpt'),
        moment: require('../scripts/helpers/moment')
      }
    }))
    .destination(path.join(dir, 'dist'))

  metalsmith.build(err => {
    if (err) {
      throw err
{'fraction_non_alphanumeric': 0.16047867444001226, 'fraction_numerical': 0.0, 'mean_word_length': 3.049689440993789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6131845', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1026, 'n_words': 207}