move non pages out of pages dir

This commit is contained in:
Felix Roos 2024-01-12 18:16:57 +01:00
parent 46a859736a
commit 9a0459fdd3
7 changed files with 17 additions and 22 deletions

View file

@ -0,0 +1,10 @@
import { getMetadata } from './metadata_parser';
export function getMyPatterns() {
const my = import.meta.glob('../../my-patterns/**', { as: 'raw', eager: true });
return Object.fromEntries(
Object.entries(my)
.filter(([name]) => name.endsWith('.txt'))
.map(([name, raw]) => [getMetadata(raw)['title'] || name.split('/').slice(-1), raw]),
);
}