diff --git a/assets/js/src/projects.js b/assets/js/src/projects.js index 0aa0cd67..3a33250a 100644 --- a/assets/js/src/projects.js +++ b/assets/js/src/projects.js @@ -1,63 +1,60 @@ import fetch from "cross-fetch"; -import { html, render } from "lit-html"; +import { render } from "lit-html"; +import { html } from "lit-html/static.js"; +import { ifDefined } from "lit-html/directives/if-defined.js"; import numeral from "numeral"; import { format, formatDistanceToNowStrict, parseJSON } from "date-fns"; import twemoji from "twemoji"; // don't continue if there isn't a span#meta-hits element on this page +// TODO: be better. const wrapper = document.getElementById("github-cards"); const spinner = document.getElementById("loading-spinner"); if (wrapper) { // this is a total sh*tshow, but safer than setting one big string via innerHTML :) + // TODO: consider making this a real LitElement? const template = (repo) => html` ${repo.name} - ${(() => { - if (repo.description) { - return html`
${repo.description}
`; - } - })()} - ${(() => { - if (repo.language) { - return html` ` + : null}