<commit_before>var hbs = require("express-hbs");
var members = require("./content/members.json");
var _ = require('lodash');

function hasTag(post, tag) {
	for (var i = 0; i < post.tags.length; i++) {
		if (post.tags[i].name == tag) {
			return true;
		}
	}
	return false;
}

registerHelpers = function() {
	String.prototype.startsWith = function(prefix) {
    return this.indexOf(prefix) === 0;
	}

	hbs.registerHelper('hasTag', function(tag, options) {
		for (var i = 0; i < this.tags.length; i++) {
			if (this.tags[i].name == tag) {
				return options.fn(this);
			}
		}
		return options.inverse(this);
	});
	hbs.registerHelper('print', function(obj, options) {
		console.log(obj);
		return options.fn(this);
	});
	hbs.registerHelper('isPhotoAlbum', function(options) {
		for (var i = 0; i < this.tags.length; i++) {
			if (this.tags[i].name == 'album') {
				return options.fn(this);
			}
		}
		return options.inverse(this);
		// if (this.markdown.startsWith('[PHOTOALBUM]')) {
		// 	return options.fn(this);
		// } else {
		// 	return options.inverse(this);
		// }
	});
	hbs.registerHelper('isAlbumPage', function(options) {
		if (this.tag.name == "album") {
			return options.fn(this);
		} else {
			return options.inverse(this);
		}
	});
	hbs.registerHelper('shouldShowPost', function(options) {
		if (hasTag(this, "album") && hasTag(this, "show")) {
			return options.inverse(this);
		} 
		return options.fn(this);
	});
	hbs.registerHelper('isMembersPage', function(options) {
		for (var i = 0; i < this.tags.length; i++) {
			if (this.tags[i].name == 'teamMembers') {
				return options.fn(this);
			}
		}
		return options.inverse(this);
	});
	hbs.registerHelper('eachPhoto', function(options) {
		var ret = "";
		var content = this.markdown;
		var matches = content.match(/\((.*?)\)/);
<commit_msg>hide albums<commit_after>var hbs = require("express-hbs");
var members = require("./content/members.json");
var _ = require('lodash');

function hasTag(post, tag) {
	for (var i = 0; i < post.tags.length; i++) {
		if (post.tags[i].name == tag) {
			return true;
		}
	}
	return false;
}

registerHelpers = function() {
	String.prototype.startsWith = function(prefix) {
    return this.indexOf(prefix) === 0;
	}

	hbs.registerHelper('hasTag', function(tag, options) {
		for (var i = 0; i < this.tags.length; i++) {
			if (this.tags[i].name == tag) {
				return options.fn(this);
			}
		}
		return options.inverse(this);
	});
	hbs.registerHelper('print', function(obj, options) {
		console.log(obj);
		return options.fn(this);
	});
	hbs.registerHelper('isPhotoAlbum', function(options) {
		for (var i = 0; i < this.tags.length; i++) {
			if (this.tags[i].name == 'album') {
				return options.fn(this);
			}
		}
		return options.inverse(this);
		// if (this.markdown.startsWith('[PHOTOALBUM]')) {
		// 	return options.fn(this);
		// } else {
		// 	return options.inverse(this);
		// }
	});
	hbs.registerHelper('isAlbumPage', function(options) {
		if (this.tag.name == "album") {
			return options.fn(this);
		} else {
			return options.inverse(this);
		}
	});
	hbs.registerHelper('shouldShowPost', function(options) {
		if (hasTag(this, "album") && !hasTag(this, "show")) {
			return options.inverse(this);
		} 
		return options.fn(this);
	});
	hbs.registerHelper('isMembersPage', function(options) {
		for (var i = 0; i < this.tags.length; i++) {
			if (this.tags[i].name == 'teamMembers') {
				return options.fn(this);
			}
		}
		return options.inverse(this);
	});
	hbs.registerHelper('eachPhoto', function(options) {
		var ret = "";
		var content = this.markdown;
		var matches = content.match(/\((.*?)\)/);

{'fraction_non_alphanumeric': 0.19380702239424938, 'fraction_numerical': 0.002764722145424385, 'mean_word_length': 3.6384615384615384, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '3161291', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1300, 'n_words': 251}