Skip to content

Commit

Permalink
Work with relative links
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jun 26, 2021
1 parent 36d18c9 commit 891ed63
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "breadcrumbs",
"name": "Breadcrumbs",
"version": "0.4.3",
"version": "0.4.4",
"minAppVersion": "0.12.5",
"description": "Visualise the hierarchy of your vault using a breadcrumb trail",
"author": "SkepticMystic",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "breadcrumbs-plugin",
"version": "0.4.3",
"version": "0.4.4",
"description": "Visualise the hierarchy of your vault using a breadcrumb trail",
"main": "main.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ export default class BreadcrumbsPlugin extends Plugin {
getFields(fileFrontmatter: fileFrontmatter, field: string): string[] {
const fieldItems: string | [] = fileFrontmatter.frontmatter[field] ?? [];
if (typeof fieldItems === "string") {
return this.splitAndDrop(fieldItems);
return this.splitAndDrop(fieldItems).map((value) =>
value.split("/").last()
);
} else {
const links = [fieldItems].flat().map((link) => link.path ?? link);
const links = [fieldItems]
.flat()
.map((link) => link.path.split("/").last() ?? link.split("/").last());
return links;
}
}
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"0.4.4": "0.12.5",
"0.4.3": "0.12.5",
"0.4.2": "0.12.5",
"0.4.1": "0.12.5",
Expand Down

0 comments on commit 891ed63

Please sign in to comment.