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