one step forward, two steps back
This commit is contained in:
parent
c019f2421f
commit
df2636b0cb
3 changed files with 26 additions and 10 deletions
22
app/components/resources-link-grid.js
Normal file
22
app/components/resources-link-grid.js
Normal file
|
@ -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"
|
||||||
|
}]);
|
||||||
|
}
|
|
@ -113,20 +113,18 @@ module.exports = exports = (state, emit) => { // eslint-disable-line
|
||||||
// H E L P E R S
|
// H E L P E R S
|
||||||
|
|
||||||
function partialFinder(markdownBody) {
|
function partialFinder(markdownBody) {
|
||||||
const regexToFindPartials = /<\w+\/>/g;
|
const regexToFindPartials = /<\w+ ?\/>/g;
|
||||||
const partials = markdownBody.match(regexToFindPartials);
|
const partials = markdownBody.match(regexToFindPartials);
|
||||||
|
|
||||||
if (!partials) return markdownBody;
|
if (!partials) return markdownBody;
|
||||||
|
|
||||||
for (const partial of partials) {
|
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
|
const fileExistsTest = exists(`./app/components/${filename}.js`); // `local` results in error if used here and file !exist
|
||||||
|
|
||||||
if (!fileExistsTest) {
|
if (!fileExistsTest) {
|
||||||
markdownBody = markdownBody.replace(partial, "");
|
markdownBody = markdownBody.replace(partial, "");
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`));
|
const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`));
|
||||||
|
|
||||||
if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction);
|
if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction);
|
||||||
|
|
|
@ -2,11 +2,7 @@
|
||||||
title: Resources
|
title: Resources
|
||||||
---
|
---
|
||||||
|
|
||||||
## Showcase
|
<ResourcesLinkGrid />
|
||||||
|
|
||||||
- [Whitepaper](https://lbry-whitepaper.herokuapp.com)
|
|
||||||
- [Blockchain API](/api/blockchain)
|
|
||||||
- [Protocol API](/api/protocol)
|
|
||||||
|
|
||||||
## Additional Resources
|
## Additional Resources
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue