<commit_before>'use strict';

var argv = require('yargs').argv;
var fs = require('fs');
var mkdirp = require('mkdirp');
var moment = require('moment');

var config = require('./config.json');
var utils = require('./utils');

function page(title, slug) {
    console.log('\n' + 'Console Message: Building Page' + '\n');
    if (title) {
        var title = argv.title || argv.t;
        var slug = utils.hyphenateString(title.toString());
        var filename = config.path.pages + slug + '.md';
        fs.access(filename, fs.F_OK, function (err) {
            if (!err) {
                return console.log('\n' + 'Task aborted: File ' + filename + ' already exists.');
            }
            var meta =
                '---\r\n' +
                'date: ' + moment().format() + '\r\n' +
                'layout: page\r\n' +
                'order: 0\r\n' +
                'navigation: false\r\n' +
                'navigationTitle: "' + title + '"\r\n' +
                'title: "' + title + '"\r\n' +
                'slug: ' + slug + '\r\n' +
                '---\r\n' +
                ' <Insert your content here> \r\n ';

            mkdirp(config.path.pages, function (err) {
                if (err) return err;
                fs.writeFile(filename, meta, function (err) {
                    if (err) return err;
                    return console.log('Task success - Your new page was successfully created: ', filename);
                });
            });
        });
    } else {
        return console.log('Error: You must enter a title for your page. Use --title "Page title" or -t "Page title"');
    }
}

module.exports = page;<commit_msg>removed if statement, removed args from page.js<commit_after>'use strict';

var argv = require('yargs').argv;
var fs = require('fs');
var mkdirp = require('mkdirp');
var moment = require('moment');

var config = require('./config.json');
var utils = require('./utils');

function page(title) {
    console.log('\n' + 'Console Message: Building Page' + '\n');
  
        var slug = utils.hyphenateString(title);
        var filename = config.path.pages + slug + '.md';
        fs.access(filename, fs.F_OK, function (err) {
            if (!err) {
                return console.log('\n' + 'Task aborted: File ' + filename + ' already exists.');
            }
            var meta =
                '---\r\n' +
                'date: ' + moment().format() + '\r\n' +
                'layout: page\r\n' +
                'order: 0\r\n' +
                'navigation: false\r\n' +
                'navigationTitle: "' + title + '"\r\n' +
                'title: "' + title + '"\r\n' +
                'slug: ' + slug + '\r\n' +
                '---\r\n' +
                ' <Insert your content here> \r\n ';

            mkdirp(config.path.pages, function (err) {
                if (err) return err;
                fs.writeFile(filename, meta, function (err) {
                    if (err) return err;
                    return console.log('Task success - Your new page was successfully created: ', filename);
                });
            });
        });
    
}

module.exports = page;
{'fraction_non_alphanumeric': 0.16417910447761194, 'fraction_numerical': 0.0006351222610352493, 'mean_word_length': 1.5609756097560976, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6758884', 'n_tokens_mistral': 950, 'n_tokens_neox': 912, 'n_words': 239}