From 272ff4ed7451656eb29c62a3ae4f7ca985b3cd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=AB=20=E3=82=A6=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=83=96?= Date: Fri, 13 Jul 2018 13:22:46 -0500 Subject: [PATCH] "Edit link" partial is fixed --- config.js | 6 +++--- views/partials/edit-link.js | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/config.js b/config.js index 9e4ef27..0d02f8f 100644 --- a/config.js +++ b/config.js @@ -4,9 +4,9 @@ module.exports = exports = { github: { - repo: "lbryio/lbry.tech", - docsBranch: "master/content", - editLinkText: "Edit this page on GitHub" + branch: "new", + linkText: "Edit this page on GitHub", + repo: "lbryio/lbry.tech" }, ga: "UA-60403362-1" }; diff --git a/views/partials/edit-link.js b/views/partials/edit-link.js index f8b2a51..daf58e5 100644 --- a/views/partials/edit-link.js +++ b/views/partials/edit-link.js @@ -16,13 +16,24 @@ const config = local("/config"); // P R O G R A M const editLink = pagePath => { - let githubUrl = `https://github.com/${config.github.repo}/edit`; + let githubUrl = `https://github.com/${config.github.repo}/edit/${config.github.branch}`; - if (pagePath === "/") githubUrl = `${githubUrl}/master/README.md`; - else githubUrl = `${githubUrl}/${config.github.docsBranch}${pagePath}.md`; // TODO: Update this to match new site structure + switch(pagePath) { + case "": + githubUrl = `${githubUrl}/views/pages/home.js`; + break; + + case "/resources": + githubUrl = `${githubUrl}/views/pages/resources.js`; + break; + + default: + githubUrl = `${githubUrl}/documents${pagePath}.md`; + break; + } return html` - ${config.github.editLinkText} + ${config.github.linkText} `; };