Fixes and linting

This commit is contained in:
ポール ウェッブ 2018-09-26 11:42:41 -05:00
parent 303caa19a4
commit 430d514e7f
7 changed files with 69 additions and 29 deletions

View file

@ -9,10 +9,7 @@
],
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
"sourceType": "module"
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],

View file

@ -1,5 +1,7 @@
"use strict";
// V A R I A B L E S
const APPLICATIONS = require("./ecosystem/module-applications");
@ -10,6 +12,10 @@ const LIGHTHOUSE = require("./ecosystem/submodule-lighthouse");
const REFLECTOR = require("./ecosystem/submodule-reflector");
const WALLET = require("./ecosystem/submodule-wallet");
// E X P O R T
export default function () {
return `
<section class="ecosystem">
@ -30,4 +36,4 @@ export default function () {
</aside>
</section>
`;
};
}

View file

@ -1,5 +1,7 @@
"use strict";
// V A R I A B L E
const links = [ // TODO: Update images
@ -39,6 +41,10 @@ const links = [ // TODO: Update images
}
];
// E X P O R T
export default function () {
const renderedLinks = [];
let imageLink = "";
@ -51,7 +57,11 @@ export default function () {
return `
<ul class="feature-links">${renderedLinks.join("")}</ul>
`;
};
}
// H E L P E R
function returnLinkTemplate(url, title, image) {
return `

View file

@ -1,7 +1,28 @@
"use strict";
// P A C K A G E
import html from "choo/html";
// E X P O R T
export default (links) => {
const renderedLinks = links.map((link) => returnLinkTemplate(link.title, link.description, link.destination, link.label));
return html`
<ul class="link-grid">
${renderedLinks}
</ul>
`;
};
// H E L P E R
function returnLinkTemplate(title, description, destination, label) {
return `
<li class="link-grid__link">
@ -11,12 +32,3 @@ function returnLinkTemplate(title, description, destination, label) {
</li>
`;
}
export default (links) => {
const renderedLinks = links.map((link) => returnLinkTemplate(link.title, link.description, link.destination, link.label));
return html`
<ul class="link-grid">
${renderedLinks}
</ul>
`;
}

View file

@ -5,11 +5,30 @@
// P A C K A G E
import html from "choo/html";
// V A R I A B L E
import linkGrid from "../components/link-grid";
// E X P O R T
const featureLinks = linkGrid([
{
description: "Learn how LBRY works with 3 easy examples",
destination: "/tour",
label: "Take the Tour",
title: "New to LBRY?"
},
{
description: "Help make LBRY better!",
destination: "/contribute",
label: "Explore our repos",
title: "Want to contribute?"
}
]);
module.exports = exports = () => html`
<div>
<section class="hero">
@ -22,17 +41,7 @@ module.exports = exports = () => html`
</section>
<section class="features">
${linkGrid([{
title: "New to LBRY?",
description: "Learn how LBRY works with 3 easy examples",
destination: "/tour",
label: "Take the Tour"
}, {
title: "New to LBRY?",
description: "Learn how LBRY works with 3 easy examples",
destination: "/tour",
label: "Take the Tour"
}])}
${featureLinks}
</section>
<section class="intro">

View file

@ -145,8 +145,8 @@ function partialFinder(markdownBody) {
if (fileExistsTest) {
const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`));
const markdownHtml = filename === "glossary-toc" ? partialFunction : partialFunction.default(); //kill special case
markdownBody = markdownBody.replace(partial, '</div>' + markdownHtml + '<div class="page__markup">');
const markdownHtml = filename === "glossary-toc" ? partialFunction : partialFunction.default(); // kill special case
markdownBody = markdownBody.replace(partial, `</div>${markdownHtml}<div class="page__markup">`);
}
}

View file

@ -18,7 +18,7 @@
"decamelize": "^2.0.0",
"dedent": "^0.7.0",
"dotenv": "^6.0.0",
"fastify": "^1.12.0",
"fastify": "^1.12.1",
"fastify-compress": "^0.7.0",
"fastify-helmet": "^2.1.0",
"fastify-plugin": "^1.2.1",
@ -59,6 +59,7 @@
"@babel/plugin-syntax-import-meta": "7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/register": "^7.0.0",
"husky": "^1.0.0",
"nodemon": "^1.18.4",
"npm-run-all": "^4.1.3",
"sass": "^1.14.0",
@ -69,6 +70,11 @@
"engines": {
"node": "10.2.x"
},
"husky": {
"hooks": {
"pre-commit": "npm run test:lint"
}
},
"main": "server.js",
"name": "lbry.tech",
"private": true,