From 5c47890b31be8477e78f21c021d5ce76b91d71e2 Mon Sep 17 00:00:00 2001 From: Peter Langenkamp Date: Thu, 29 Oct 2020 17:27:35 +0100 Subject: [PATCH] fix for references in deployed version --- plugins/terminology-parser/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/terminology-parser/index.js b/plugins/terminology-parser/index.js index 9cca9cd..6d8c24b 100644 --- a/plugins/terminology-parser/index.js +++ b/plugins/terminology-parser/index.js @@ -143,7 +143,9 @@ async function getGlossaryTerms(files) { // Get the popup text for the term let hoverText = await getHoverText(referencePath); - const new_final_url = referencePath.slice(1,-3); + const glossary_file_path = path.resolve(process.cwd(), glossaryPath); + const term_path = path.resolve(process.cwd(), TERMS_DIR, reference); + const new_final_url = getRelativePath(glossary_file_path, term_path); if (hoverText === undefined) { var new_text = ('' + text + ''); @@ -173,7 +175,7 @@ function generateGlossary(data) { let undefineds = ""; data.forEach(item => { if (item.title !== undefined) { - if (item.hoverText === undefined) { + if (item.glossaryText === undefined) { undefineds = undefineds + `\n- [${item.title}](${item.filepath})\n`; } else { content = content + `\n\n### **[${item.title}](${item.filepath})**\n${item.glossaryText}\n`; -- GitLab