Ignore uppercase-only filenames (like README.md)
This commit is contained in:
parent
510da4d641
commit
5c31f0798e
1 changed files with 5 additions and 1 deletions
6
mkht.php
6
mkht.php
|
@ -73,9 +73,13 @@ foreach($nodes as $node) {
|
||||||
copy($src, $target);
|
copy($src, $target);
|
||||||
if ($node_info->getExtension() !== 'md')
|
if ($node_info->getExtension() !== 'md')
|
||||||
continue;
|
continue;
|
||||||
$pages[] = $node;
|
|
||||||
|
|
||||||
preg_match('/(?<pagename>[-\w]+)(?:\.(?<lang>[a-z]{2}))?\.md/', $path_parts_src['basename'], $matches);
|
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)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$pages[] = $node;
|
||||||
|
|
||||||
$lang = $matches['lang'] ?? $config['default-lang'] ?? exit('no language found for ' . $src . LF);
|
$lang = $matches['lang'] ?? $config['default-lang'] ?? exit('no language found for ' . $src . LF);
|
||||||
|
|
||||||
$pages_langs[$path_parts_src['dirname'] . '/' . $matches['pagename']][] = $lang;
|
$pages_langs[$path_parts_src['dirname'] . '/' . $matches['pagename']][] = $lang;
|
||||||
|
|
Loading…
Reference in a new issue