diff --git a/.eslintrc.js b/.eslintrc.js index d773762..8d01eba 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,7 +23,8 @@ module.exports = { "prettier/prettier": [ "error", { - "singleQuote": true + "singleQuote": true, + "trailingComma": "all", } ] } diff --git a/README.md b/README.md index 50d6fb1..3144334 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ All the links are monitored and tested with [awesome_bot](https://github.com/dkh # Contents + + - Introduction - [What is Docker?](#what-is-docker) - [Where to start?](#where-to-start) @@ -44,6 +46,7 @@ All the links are monitored and tested with [awesome_bot](https://github.com/dkh - [Builder](#builder) - [Dockerfile](#dockerfile) - [Linter](#linter) + - [Metadata](#metadata) - [Registry](#registry) - [Development with Docker](#development-with-docker) - [API Client](#api-client) @@ -53,14 +56,14 @@ All the links are monitored and tested with [awesome_bot](https://github.com/dkh - [Serverless](#serverless) - [Testing](#testing) - [Wrappers](#wrappers) - - [Services based on Docker ($$$)](#services-based-on-docker-) + - [Services based on Docker (:heavy_dollar_sign:)](#services-based-on-docker-heavy_dollar_sign) - [CI/CD](#ci-services) - [CaaS](#caas) - - [Monitoring](#monitoring-services) + - [Monitoring Services](#monitoring-services) - [Useful Resources](#useful-resources) - [Awesome Lists](#awesome-lists) - [Good Tips](#good-tips) - - [Raspberry Pi / ARM](#raspberry-pi--arm) + - [Raspberry Pi & ARM](#raspberry-pi--arm) - [Security](#security-1) - [Videos](#videos) - [Communities and Meetups](#communities-and-meetups) @@ -69,6 +72,8 @@ All the links are monitored and tested with [awesome_bot](https://github.com/dkh - [English](#english) - [Russian](#russian) + + # Legend - Abandoned :skull: diff --git a/build.js b/build.js index 6bdfb9f..7090fee 100644 --- a/build.js +++ b/build.js @@ -2,11 +2,23 @@ const fs = require('fs'); const showdown = require('showdown'); const cheerio = require('cheerio'); const Parcel = require('parcel-bundler'); -const critical = require('critical'); process.env.NODE_ENV = 'production'; -const includeReadme = () => { +process.on('unhandledRejection', error => { + console.log('unhandledRejection', error.message); +}); + +const readme = 'README.md'; +const template = 'website/index.tmpl.html'; +const merged = 'website/index.html'; +const destination = 'website/index.html'; + +const includeReadme = ({ + md = readme, + templateHTML = template, + dest = merged, +}) => { const converter = new showdown.Converter({ omitExtraWLInCodeBlocks: true, simplifiedAutoLink: true, @@ -24,62 +36,36 @@ const includeReadme = () => { ghMentions: true, backslashEscapesHTMLTags: true, emoji: true, - splitAdjacentBlockquotes: true + splitAdjacentBlockquotes: true, }); // converter.setFlavor('github'); console.log('Loading files...'); - const index = fs.readFileSync('website/index.tmpl.html', 'utf8'); - const readme = fs.readFileSync('README.md', 'utf8'); + const indexTemplate = fs.readFileSync(templateHTML, 'utf8'); + const markdown = fs.readFileSync(md, 'utf8'); console.log('Merging files...'); - const $ = cheerio.load(index); - $('#md').append(converter.makeHtml(readme)); + const $ = cheerio.load(indexTemplate); + $('#md').append(converter.makeHtml(markdown)); console.log('Writing index.html'); - fs.writeFileSync('website/index.merged.html', $.html(), 'utf8'); - return { base: 'website/', src: 'index.merged.html' }; + fs.writeFileSync(dest, $.html(), 'utf8'); + console.log('DONE 👍'); }; -const css = ({ base, src }) => { - console.log(''); - console.log('Generating critical css above the fold'); - console.log(''); - const dimensions = [ - { - height: 200, - width: 500 - }, - { - height: 900, - width: 1200 - } - ]; - const options = { - inline: true, - base, - src, - dest: 'index.html', - dimensions - }; - - return critical.generate(options); -}; - -const bundle = () => { +const bundle = (dest = destination) => { console.log(''); console.log('Bundling with Parcel.js'); console.log(''); - new Parcel('website/index.html', { + new Parcel(dest, { name: 'build', - publicURL: '/' + publicURL: '/', }).bundle(); }; -const main = async () => { - const { base, src } = includeReadme(); - await css({ base, src }); +const main = () => { + includeReadme({}); bundle(); }; diff --git a/website/index.tmpl.html b/website/index.tmpl.html index bcf925e..242eff6 100644 --- a/website/index.tmpl.html +++ b/website/index.tmpl.html @@ -9,9 +9,185 @@ - + - + + diff --git a/website/style.css b/website/style.css index 188f94f..9ce60ed 100644 --- a/website/style.css +++ b/website/style.css @@ -318,3 +318,4 @@ a:hover { text-decoration: underline; } .site-footer-owner { display: block; font-weight: bold; } .site-footer-credits { color: #819198; } +