<commit_before>'use strict';
var Poet = require('poet');
var _ = require('lodash');

module.exports = function(app) {
	var poet = Poet(app, {
		posts: './posts/',
		routes: {
			'/:post': 'post',
			'/?page=:page': 'page',
			'/tags/:tag': 'tag',
			'/categories/:category': 'category'
		},
		readMoreLink: function(post) {
			return `<a href="${post.url}" class="read-more-link" itemprop="url">Continue reading ${post.title}</a>`;
		}
	});

	app.locals.poet = poet;

	if (app.locals.isProduction) {
		// Initiate the poet watcher (to reload when changes are made to blog posts)
		// and then init poet itself
		poet.watch();
	}

	// Override some of the default blog URLs

	app.get('/', function (req, res) {
		res.render('index', {
			meta_title: "It's a Duffy Thing - Blog Posts by <NAME>",
			meta_description: "Blog posts by <NAME> covering everything tech",
			posts: poet.helpers.getPosts(0, 5)
		});
	});<commit_msg>Fixed the Poet watcher only loading on production, rather than not loading on production<commit_after>'use strict';
var Poet = require('poet');
var _ = require('lodash');

module.exports = function(app) {
	var poet = Poet(app, {
		posts: './posts/',
		routes: {
			'/:post': 'post',
			'/?page=:page': 'page',
			'/tags/:tag': 'tag',
			'/categories/:category': 'category'
		},
		readMoreLink: function(post) {
			return `<a href="${post.url}" class="read-more-link" itemprop="url">Continue reading ${post.title}</a>`;
		}
	});

	app.locals.poet = poet;

	if (!app.locals.isProduction) {
		// Initiate the poet watcher (to reload when changes are made to blog posts)
		// and then init poet itself
		poet.watch();
	}

	// Override some of the default blog URLs

	app.get('/', function (req, res) {
		res.render('index', {
			meta_title: "It's a Duffy Thing - Blog Posts by <NAME>",
			meta_description: "Blog posts by <NAME> covering everything tech",
			posts: poet.helpers.getPosts(0, 5)
		});
	});
{'fraction_non_alphanumeric': 0.17983367983367984, 'fraction_numerical': 0.002079002079002079, 'mean_word_length': 3.6951219512195124, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7170201', 'n_tokens_mistral': 739, 'n_tokens_neox': 656, 'n_words': 187}