fix langs managment
This commit is contained in:
parent
dcea304d8f
commit
4413249693
1 changed files with 2 additions and 1 deletions
3
mkht.php
3
mkht.php
|
@ -50,7 +50,6 @@ function clearnetOrOnion($clearnet_url, $onion_url) {
|
|||
}
|
||||
|
||||
$dirs_last_update = [];
|
||||
$dirs_entries = [];
|
||||
$pages_langs = [];
|
||||
|
||||
$nodes = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(SITE, RecursiveDirectoryIterator::SKIP_DOTS));
|
||||
|
@ -80,6 +79,7 @@ foreach($nodes as $node) {
|
|||
$lang = $matches['lang'] ?? $config['default-lang'] ?? exit('no language found for ' . $src . LF);
|
||||
|
||||
$pages_langs[$path_parts_src['dirname'] . '/' . $matches['pagename']][] = $lang;
|
||||
$files_langs[$src] = $lang;
|
||||
$page_names[$src] = $matches['pagename'];
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,7 @@ foreach ($pages as $node) {
|
|||
$base_filepath_target = $path_parts_target['dirname'] . '/' . $path_parts_target['filename'];
|
||||
|
||||
$content = file_get_contents($src);
|
||||
$lang = $files_langs[$src];
|
||||
|
||||
preg_match('/^# (?<title>.*)$/Dm', $content, $matches);
|
||||
$title = $matches['title'] ?? NULL;
|
||||
|
|
Loading…
Reference in a new issue