<commit_before>require('harmonize')();

var Metalsmith  = require('metalsmith'),
  markdown      = require('metalsmith-markdown'),
  permalink     = require('metalsmith-permalinks'),
  layouts       = require('metalsmith-layouts'),
  serve         = require('metalsmith-serve'),
  sass          = require('metalsmith-sass'),
  assets        = require('metalsmith-assets'),
  collections   = require('metalsmith-collections');

var m = Metalsmith(__dirname)
  .use(collections({
    posts: {
      pattern: 'content/posts/*.md'
    },
    pages: {
      pattern: 'content/pages/*.md'
    }
  }))
  .use(markdown())
  .use(permalink({
    pattern: ':collection/:date/:title'
  }))
  .use(layouts({
    'engine': 'handlebars',
    partials: 'partials'
  }))
  .use(assets({
    source: 'src/assets', // relative to the working directory 
    destination: './assets' // relative to the build directory 
  }))
  // Process css
  .use(sass({
    sourceMap: true,
    sourceMapContents: true
  }))
  .destination('./build');

if (process.argv[2] === '--serve') {
  m.use(serve({}));
}

m.build(function (err) {
  if (err) {
    console.error(err);
  }
});<commit_msg>Add socials metadata and in-place plugin<commit_after>require('harmonize')();

var socials = {
  'facebook-square': 'https://www.facebook.com/romajs.org',
  'twitter-square': 'https://twitter.com/roma_js',
  'youtube-square': 'https://www.youtube.com/channel/UCFm8OPi5USbFybw9SaTLxeA',
  'slack': 'https://romajs.herokuapp.com/',
  'github': 'https://github.com/Roma-JS',
  'google-plus-square': 'https://plus.google.com/communities/114324393897443067092'
};

var Metalsmith  = require('metalsmith'),
  sass          = require('metalsmith-sass'),
  serve         = require('metalsmith-serve'),
  assets        = require('metalsmith-assets'),
  layouts       = require('metalsmith-layouts'),
  inPlace       = require('metalsmith-in-place'),
  markdown      = require('metalsmith-markdown'),
  permalinks    = require('metalsmith-permalinks'),
  collections   = require('metalsmith-collections');

var m = Metalsmith(__dirname)
  .use(collections({
    posts: {
      pattern: 'content/posts/*.md'
    },
    pages: {
      pattern: 'content/pages/*.md'
    }
  }))
  .use(markdown())
  .use(permalinks({
    pattern: ':title',
    linksets: [{
      match: {collection: 'posts'},
      pattern: 'blog/:date/:title'
    }]
  }))
  .use(function(files, metalsmith, done) {
    var meta = metalsmith.metadata();
    meta.socials = socials;
    done();
  })
  .use(layouts({
    engine: 'handlebars',
    partials: 'partials'
  }))
  .use(inPlace({
    engine: 'handlebars'
  }))
  .use(assets({
    source: 'src/assets', // relative to the working directory 
    destination: './assets' // relative to the build directory 
  }))
  .use(assets({
    source: 'node_modules/font-awesome/fonts',
    destination: './assets/fonts'
  }))
  // Process css
  .use(sass({
    sourceMap: true,
    sourceMapContents: true
  }))
  .destination('./build');

if (process.argv[2] === '--serve') {
  m.use(serve({}));
}

m.build(function (err) {
  if (err) {
    console.error(err);
  }
});
{'fraction_non_alphanumeric': 0.18422733077905493, 'fraction_numerical': 0.008301404853128991, 'mean_word_length': 3.111548556430446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '3642106', 'n_tokens_mistral': 1132, 'n_tokens_neox': 1073, 'n_words': 182}