don't skip digit-only page names

This commit is contained in:
Miraty 2024-09-21 23:22:02 +02:00
parent c376d39022
commit b4221fb324

View file

@ -101,7 +101,7 @@ foreach($nodes_cache as $node) {
continue;
preg_match('/(?<pagename>[-\w]+)(?:\.(?<lang>[a-z]{2}))?\.md/', $path_parts_src['basename'], $matches);
if ($matches['pagename'] === strtoupper($matches['pagename'])) // Ignore uppercase-only filenames (like README.md)
if ($matches['pagename'] === strtoupper($matches['pagename']) AND $matches['pagename'] !== strtolower($matches['pagename'])) // Skip uppercase-only filenames (like README.md), but not digit-only (like 404.md)
continue;
$pages[] = $node;
@ -280,7 +280,7 @@ foreach ($pages as $node) {
$relative_addr = str_replace(SITE . 'cache/', '', $base_filepath_src . '.html');
// As of RFC 3151: A URN Namespace for Public Identifiers
// According to RFC 3151: A URN Namespace for Public Identifiers
$public_id = 'urn:publicid:' . $config['id'] . str_replace('/', '%2F', $relative_addr);
preg_match('#\<body\>(?<content>.*)\</body\>#s', file_get_contents($base_filepath_target . '.html'), $match);