From 5c31f0798e71b131fd71657bc3b72efcfed89cee Mon Sep 17 00:00:00 2001 From: Miraty Date: Fri, 3 Nov 2023 11:05:25 +0100 Subject: [PATCH] Ignore uppercase-only filenames (like README.md) --- mkht.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkht.php b/mkht.php index be93b2e..d79fcdf 100755 --- a/mkht.php +++ b/mkht.php @@ -73,9 +73,13 @@ foreach($nodes as $node) { copy($src, $target); if ($node_info->getExtension() !== 'md') continue; - $pages[] = $node; preg_match('/(?[-\w]+)(?:\.(?[a-z]{2}))?\.md/', $path_parts_src['basename'], $matches); + if ($matches['pagename'] === strtoupper($matches['pagename'])) // Ignore uppercase-only filenames (like README.md) + continue; + + $pages[] = $node; + $lang = $matches['lang'] ?? $config['default-lang'] ?? exit('no language found for ' . $src . LF); $pages_langs[$path_parts_src['dirname'] . '/' . $matches['pagename']][] = $lang;