* 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
9 lines
172 B
TypeScript
9 lines
172 B
TypeScript
const regex = /([^/]+)\.md$/;
|
|
|
|
const getTitle = (path: string): string => {
|
|
const match = path.match(regex);
|
|
return match ? match[1] : '';
|
|
};
|
|
|
|
export { getTitle };
|