refactor attempt #146
2 changed files with 2 additions and 29 deletions
|
@ -1,11 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
|
||||
|
||||
// P A C K A G E
|
||||
|
||||
import Component from "choo/component";
|
||||
|
||||
// V A R I A B L E
|
||||
|
||||
const links = [ // TODO: Update images
|
||||
|
@ -45,13 +39,7 @@ const links = [ // TODO: Update images
|
|||
}
|
||||
];
|
||||
|
||||
|
||||
|
||||
// P R O G R A M
|
||||
|
||||
FeaturedLinks.prototype = Object.create(Component.prototype);
|
||||
|
||||
FeaturedLinks.prototype.createElement = () => {
|
||||
export default function () {
|
||||
const renderedLinks = [];
|
||||
let imageLink = "";
|
||||
|
||||
|
@ -65,21 +53,6 @@ FeaturedLinks.prototype.createElement = () => {
|
|||
`;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// E X P O R T
|
||||
|
||||
module.exports = exports = FeaturedLinks;
|
||||
|
||||
|
||||
|
||||
// H E L P E R S
|
||||
|
||||
function FeaturedLinks() {
|
||||
if (!(this instanceof FeaturedLinks)) return new FeaturedLinks();
|
||||
Component.call(this);
|
||||
}
|
||||
|
||||
function returnLinkTemplate(url, title, image) {
|
||||
return `
|
||||
<li class="feature-link">
|
||||
|
|
|
@ -146,7 +146,7 @@ function partialFinder(markdownBody) {
|
|||
if (fileExistsTest) {
|
||||
const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`));
|
||||
|
||||
if (filename === "ecosystem" || filename === "feature-links") {
|
||||
if (filename === "ecosystem") {
|
||||
const neatPartial = new partialFunction;
|
||||
markdownBody = markdownBody.replace(partial, neatPartial.render());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue