From 891ed63adac3ddd455a43163714215a484e70a23 Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Sat, 26 Jun 2021 14:33:03 +0200 Subject: [PATCH] Work with relative links --- manifest.json | 2 +- package.json | 2 +- src/main.ts | 8 ++++++-- versions.json | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index fe18caaf..3dcd0481 100644 --- a/manifest.json +++ b/manifest.json @@ -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", diff --git a/package.json b/package.json index f6081198..0424d277 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/main.ts b/src/main.ts index ab61c32f..8daee105 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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; } } diff --git a/versions.json b/versions.json index da115257..d53b038b 100644 --- a/versions.json +++ b/versions.json @@ -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",