limit to .md files
This commit is contained in:
parent
feb3fad070
commit
1baf2f76c9
|
@ -124,11 +124,11 @@
|
||||||
session_start();
|
session_start();
|
||||||
if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
|
if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
|
||||||
{
|
{
|
||||||
$files = glob($dir . '/*');
|
$files = glob($dir . '/*.md');
|
||||||
usort($files, function($a, $b)
|
usort($files, function($a, $b)
|
||||||
{
|
{
|
||||||
return filemtime($b) - filemtime($a);
|
return filemtime($b) - filemtime($a);
|
||||||
});
|
});
|
||||||
$_SESSION['index'] = array_map(fn($value): string => str_replace('.md', '', $value), $files);
|
$_SESSION['index'] = array_map(fn($value): string => str_replace('.md', '', $value), $files);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -39,10 +39,6 @@
|
||||||
foreach($_SESSION['index'] as $path)
|
foreach($_SESSION['index'] as $path)
|
||||||
{
|
{
|
||||||
$name = basename($path);
|
$name = basename($path);
|
||||||
if (str_ends_with($name, '.del'))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($filter)
|
if ($filter)
|
||||||
{
|
{
|
||||||
|
@ -64,4 +60,4 @@
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue