diff --git a/themes/openaq/assets/js/blog.js b/themes/openaq/assets/js/blog.js deleted file mode 100644 index c9cf52e3..00000000 --- a/themes/openaq/assets/js/blog.js +++ /dev/null @@ -1,40 +0,0 @@ -(async () => { - - const placeholder = document.querySelector('.placeholder-item'); - // placeholder is used to ensure classes are not purged by purgecss - placeholder.remove() - const list = document.querySelector('.items'); - const res = await fetch('https://medium.openaq.org').catch(() => { - const errorHtml = ` - - Failed to fetch blog items. Visit OpenAQ on Medium - `; - list.insertAdjacentHTML('beforeend', errorHtml); - return; - }); - const feed = await res.text(); - const data = new window.DOMParser().parseFromString(feed, "text/xml"); - const items = data.querySelectorAll("item"); - let year; - for (const item of items) { - const title = item.querySelector("title").innerHTML.match(/\<\!\[CDATA\[(.*)\]{2}\>/) - const publicationDate = new Date(item.querySelector("pubDate").innerHTML) - let content = item.getElementsByTagName('content:encoded'); - content = content[0].innerHTML.replace(/\.*\<\/figcaption\>/g, ' ') - const link = item.getElementsByTagName('link')[0].innerHTML - let html = ''; - if (publicationDate.getFullYear() != year) { - html += `

${publicationDate.getFullYear()}

`; - year = publicationDate.getFullYear(); - } - html += `
- ${publicationDate.toLocaleDateString('en-us', { month:"long", day:"numeric"})} -
-
${title[1]}
-

${content.replace(/<\/?[^>]+(>|$)/g, "").slice(0, 250)}...

-
-
-
` - list.insertAdjacentHTML('beforeend', html); - } -})(); \ No newline at end of file diff --git a/themes/openaq/layouts/about/blog/list.html b/themes/openaq/layouts/about/blog/list.html deleted file mode 100644 index 427a00ec..00000000 --- a/themes/openaq/layouts/about/blog/list.html +++ /dev/null @@ -1,36 +0,0 @@ -{{ define "main" }} -{{ partial "breadcrumbs" . }} -
- - {{ partial "bubbles" }} - - -
-
-

{{ .Title }}

- -
-
-
-{{ partial "community-banner" . }} -{{ partial "explore-banner" . }} -{{ end }} - - -{{ define "scripts" }} -{{ $js := resources.Get "js/blog.js" | js.Build | resources.Minify }} -{{ $secureJS := $js | resources.Fingerprint "sha512" }} - - -{{ end }} \ No newline at end of file diff --git a/themes/openaq/layouts/partials/header.html b/themes/openaq/layouts/partials/header.html index 8d4af444..b42298da 100644 --- a/themes/openaq/layouts/partials/header.html +++ b/themes/openaq/layouts/partials/header.html @@ -38,7 +38,7 @@ - +