feature: initial commit
This commit is contained in:
commit
ce024ba87a
17 changed files with 1141 additions and 0 deletions
18
organizers/by_lurid.ts
Normal file
18
organizers/by_lurid.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import sanitize from '../utils/sanitize.ts';
|
||||
|
||||
export default function by_lurid(id: string): string[] {
|
||||
// Replace invalid filename characters and leading dots
|
||||
const sanitized_id = sanitize(id);
|
||||
|
||||
// assuming a lurid, eg: able-fish-cost-them-post-many-form-hope-wife-born
|
||||
// ./able-fish-cost-them/able-fish-cost-them-post-many-form/able-fish-cost-them-post-many-form-hope-wife-born.json
|
||||
|
||||
const result: string[] = [
|
||||
sanitized_id.slice(0, 14),
|
||||
sanitized_id.slice(0, 34),
|
||||
sanitized_id,
|
||||
`${sanitized_id}.json`
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue