From df2636b0cb4fe1ebdc37ded808a40b0bb4b9f6f1 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 24 Sep 2018 17:58:31 -0400 Subject: [PATCH] one step forward, two steps back --- app/components/resources-link-grid.js | 22 ++++++++++++++++++++++ app/views/redirect.js | 8 +++----- documents/resources.md | 6 +----- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 app/components/resources-link-grid.js diff --git a/app/components/resources-link-grid.js b/app/components/resources-link-grid.js new file mode 100644 index 0000000..a09c742 --- /dev/null +++ b/app/components/resources-link-grid.js @@ -0,0 +1,22 @@ +"use strict"; + +import linkGrid from "./link-grid" + +export default () => { + return linkGrid([{ + title: "Whitepaper", + description: "It's a white paper", + destination: "/whitepaper", + label: "Read" + }, { + title: "Blockchain Docs", + description: "Learn how to talk to blockchain real good", + destination: "/api/blockchain", + label: "Blockchain API" + }, { + title: "LBRYnet docs", + description: "Learn wtf this is", + destination: "/api/protocol", + label: "SDK API LOL" + }]); +} diff --git a/app/views/redirect.js b/app/views/redirect.js index 1593f45..e4b936d 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -113,20 +113,18 @@ module.exports = exports = (state, emit) => { // eslint-disable-line // H E L P E R S function partialFinder(markdownBody) { - const regexToFindPartials = /<\w+\/>/g; + const regexToFindPartials = /<\w+ ?\/>/g; const partials = markdownBody.match(regexToFindPartials); if (!partials) return markdownBody; for (const partial of partials) { - const filename = decamelize(partial, "-").replace("<", "").replace("/>", ""); + const filename = decamelize(partial, "-").replace("<", "").replace("/>", "").trim(); const fileExistsTest = exists(`./app/components/${filename}.js`); // `local` results in error if used here and file !exist if (!fileExistsTest) { markdownBody = markdownBody.replace(partial, ""); - } - - else { + } else { const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`)); if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction); diff --git a/documents/resources.md b/documents/resources.md index ef08db8..8afbc25 100644 --- a/documents/resources.md +++ b/documents/resources.md @@ -2,11 +2,7 @@ title: Resources --- -## Showcase - -- [Whitepaper](https://lbry-whitepaper.herokuapp.com) -- [Blockchain API](/api/blockchain) -- [Protocol API](/api/protocol) + ## Additional Resources