Files
RSSHub/lib/routes/obsidian/utils.ts
T
MarshallandTony d5f7821d65 feat(route): add route of obsidian publish (#16872)
* feat(route): add route of obsidian publish

* feat(obsidian): Improve type safety by using DataItem in publish route

* Update lib/routes/obsidian/publish.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update lib/routes/obsidian/publish.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* feat(obsidian): improve publish page data extraction

* fix(obsidian): remove redundant namespace from route names

* Update lib/routes/obsidian/publish.ts
2024-09-24 15:25:20 +08:00

9 lines
172 B
TypeScript

const regex = /([^/]+)\.md$/;
const getTitle = (path: string): string => {
const match = path.match(regex);
return match ? match[1] : '';
};
export { getTitle };