<commit_before><?php

if (!defined("HYPERLIGHT_INIT")) die();

function rss_xml($Blog) {
	$title = Config::Title;
	$url = get_base_url() . Config::Root;
	$lastBuildDate = gmdate(DATE_RFC2822, $Blog->posts[0]->timestamp);

	header("Content-Type: application/rss+xml;");
	echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
<channel>
	<title>{$title}</title>
	<atom:link href=\"{$url}rss\" rel=\"self\" type=\"application/rss+xml\" />
	<description>{$title}</description>
	<link>{$url}</link>
	<lastBuildDate>{$lastBuildDate}</lastBuildDate>";
	foreach ($Blog->posts as $key => $post) {
		$pubDate = gmdate(DATE_RFC2822, $post->timestamp);
		echo "<item>";
		echo "<title>{$post->title}</title>";
		echo "<pubDate>{$pubDate}</pubDate>";
		echo "<link>{$url}post/{$post->slug}</link>";
		echo "<guid>{$url}post/{$post->slug}</guid>";
		if ($post->summary !== "") { echo "<description>{$post->summary}</description>"; }
		foreach ($post->tags as $key => $category) {
			echo "<category>{$category}</category>";
		}
		echo "</item>";
	}
	echo "</channel></rss>";
}

switch ($rss) {
	case "xml":
		rss_xml($Blog);
		break;
	case "json":
		header("Content-Type: application/json;");
		echo json_encode($Blog->posts);
		break;
	default:
		header("HTTP/1.0 404 Not Found");
		die("HTTP/1.0 404 Not Found");
		break;
}
?>
<commit_msg>Add generator tag to RSS XML<commit_after><?php

if (!defined("HYPERLIGHT_INIT")) die();

function rss_xml($Blog) {
	$title = Config::Title;
	$url = get_base_url() . Config::Root;
	$lastBuildDate = gmdate(DATE_RFC2822, $Blog->posts[0]->timestamp);

	header("Content-Type: application/rss+xml;");
	echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">
<channel>
	<title>{$title}</title>
	<atom:link href=\"{$url}rss\" rel=\"self\" type=\"application/rss+xml\" />
	<description>{$title}</description>
	<generator>Hyperlight CMS</generator>
	<link>{$url}</link>
	<lastBuildDate>{$lastBuildDate}</lastBuildDate>";
	foreach ($Blog->posts as $key => $post) {
		$pubDate = gmdate(DATE_RFC2822, $post->timestamp);
		echo "<item>";
		echo "<title>{$post->title}</title>";
		echo "<pubDate>{$pubDate}</pubDate>";
		echo "<link>{$url}post/{$post->slug}</link>";
		echo "<guid>{$url}post/{$post->slug}</guid>";
		if ($post->summary !== "") { echo "<description>{$post->summary}</description>"; }
		foreach ($post->tags as $key => $category) {
			echo "<category>{$category}</category>";
		}
		echo "</item>";
	}
	echo "</channel></rss>";
}

switch ($rss) {
	case "xml":
		rss_xml($Blog);
		break;
	case "json":
		header("Content-Type: application/json;");
		echo json_encode($Blog->posts);
		break;
	default:
		header("HTTP/1.0 404 Not Found");
		die("HTTP/1.0 404 Not Found");
		break;
}
?>

{'fraction_non_alphanumeric': 0.24876150035385705, 'fraction_numerical': 0.020523708421797595, 'mean_word_length': 5.0665236051502145, 'pattern_counts': {'":': 4, '<': 63, '<?xml version=': 2, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, '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': '1406978', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1020, 'n_words': 183}