diff --git a/.gitignore b/.gitignore index e50c4e7..a2e8584 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ node_modules .cache dist package-lock.json +website/index.merged.html +website/index.html diff --git a/build.js b/build.js index 4c04a27..4dfb0fa 100644 --- a/build.js +++ b/build.js @@ -2,46 +2,75 @@ 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 converter = new showdown.Converter({ - omitExtraWLInCodeBlocks: true, - simplifiedAutoLink: true, - excludeTrailingPunctuationFromURLs: true, - literalMidWordUnderscores: true, - strikethrough: true, - tables: true, - tablesHeaderId: true, - ghCodeBlocks: true, - tasklists: true, - disableForced4SpacesIndentedSublists: true, - simpleLineBreaks: true, - requireSpaceBeforeHeadingText: true, - ghCompatibleHeaderId: true, - ghMentions: true, - backslashEscapesHTMLTags: true, - emoji: true, - splitAdjacentBlockquotes: true -}); -// converter.setFlavor('github'); +const main = () => { + const converter = new showdown.Converter({ + omitExtraWLInCodeBlocks: true, + simplifiedAutoLink: true, + excludeTrailingPunctuationFromURLs: true, + literalMidWordUnderscores: true, + strikethrough: true, + tables: true, + tablesHeaderId: true, + ghCodeBlocks: true, + tasklists: true, + disableForced4SpacesIndentedSublists: true, + simpleLineBreaks: true, + requireSpaceBeforeHeadingText: true, + ghCompatibleHeaderId: true, + ghMentions: true, + backslashEscapesHTMLTags: true, + emoji: true, + splitAdjacentBlockquotes: true + }); + // converter.setFlavor('github'); -console.log('Loading files...'); -const index = fs.readFileSync('website/index.tmpl', 'utf8'); -const readme = fs.readFileSync('README.md', 'utf8'); + console.log('Loading files...'); + const index = fs.readFileSync('website/index.tmpl.html', 'utf8'); + const readme = fs.readFileSync('README.md', 'utf8'); -console.log('Merging files...'); -const $ = cheerio.load(index); -$('#md').append(converter.makeHtml(readme)); + console.log('Merging files...'); + const $ = cheerio.load(index); + $('#md').append(converter.makeHtml(readme)); -console.log('Writing index.html'); -fs.writeFileSync('website/index.html', $.html(), 'utf8'); + console.log('Writing index.html'); + fs.writeFileSync('website/index.merged.html', $.html(), 'utf8'); -console.log('Bundling with Parcel.js'); -console.log(''); + console.log(''); + console.log('Generating critical css above the fold'); + console.log(''); -new Parcel('website/index.html', { - name: 'build', - // publicURL: '/awesome-docker' - publicURL: '/' -}).bundle(); + critical + .generate({ + inline: true, + base: 'website/', + src: 'index.merged.html', + dest: 'index.html', + css: 'website/style.css', + dimensions: [ + { + height: 200, + width: 500 + }, + { + height: 900, + width: 1200 + } + ] + }) + .then(() => { + console.log('Bundling with Parcel.js'); + console.log(''); + + new Parcel('website/index.html', { + name: 'build', + // publicURL: '/awesome-docker' + publicURL: '/' + }).bundle(); + }); +}; + +main(); diff --git a/critical-css.js b/critical-css.js deleted file mode 100644 index 5a88617..0000000 --- a/critical-css.js +++ /dev/null @@ -1,30 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const tmpDir = require('os').tmpdir(); -const request = require('request'); -const criticalcss = require('criticalcss'); - -const cssUrl = - 'https://awesome-docker.netlify.com/16dc205b0ca3044a54bfb5fc8384de31.css'; -const cssPath = path.join(tmpDir, 'style.css'); -request(cssUrl) - .pipe(fs.createWriteStream(cssPath)) - .on('close', () => { - criticalcss.getRules(cssPath, (err, output) => { - if (err) { - throw new Error(err); - } else { - criticalcss.findCritical( - 'https://awesome-docker.netlify.com/', - { rules: JSON.parse(output) }, - (err, output) => { - if (err) { - throw new Error(err); - } else { - console.log(output); - } - } - ); - } - }); - }); diff --git a/package.json b/package.json index 4066192..7ab651a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "> A curated list of Docker resources and projects Inspired by [@sindresorhus](https://github.com/sindresorhus)' [awesome][sindresorhus] and improved by these **[amazing contributors](https://github.com/veggiemonk/awesome-docker/graphs/contributors)**.", "main": "index.js", "scripts": { - "build": "rimraf ./dist/ && node build.js", + "build": "rimraf ./dist/ && node build.js && rimraf ./website/index.html", "convert": "showdown makehtml -i README.md -o README.html --omitExtraWLInCodeBlocks --simplifiedAutoLink --excludeTrailingPunctuationFromURLs --literalMidWordUnderscores --strikethrough --tables --tablesHeaderId --ghCodeBlocks --tasklists --disableForced4SpacesIndentedSublists --simpleLineBreaks --requireSpaceBeforeHeadingText --ghCompatibleHeaderId --ghMentions --backslashEscapesHTMLTags --emoji --splitAdjacentBlockquotes", "package": "parcel build index.html --public-url /awesome-docker" }, @@ -20,10 +20,8 @@ "homepage": "https://github.com/veggiemonk/awesome-docker#readme", "dependencies": { "cheerio": "^1.0.0-rc.2", - "criticalcss": "^2.1.0", - "inline-assets": "^1.2.4", + "critical": "^1.1.1", "parcel-bundler": "^1.6.2", - "request": "^2.85.0", "rimraf": "^2.6.2", "showdown": "^1.8.6" }, diff --git a/website/index.html b/website/index.html deleted file mode 100644 index 5660570..0000000 --- a/website/index.html +++ /dev/null @@ -1,913 +0,0 @@ - - - - - Awesome-docker - - - - - - - - - - - - -

Awesome Docker Awesome Join the chat at https://gitter.im/veggiemonk/awesome-docker Say Thanks

-
-

A curated list of Docker resources and projects
- Inspired by @sindresorhus' awesome and improved by these amazing contributors.

-
-

It's now a GitHub project because it's considerably easier for other people to edit, fix and expand on Docker using GitHub.
-Just click README.md to submit a pull request.
-If this list is not complete, you can contribute to make it so. Here is a great video tutorial to contribute on Github

-

You can see the updates from TWITTER

-
-

Please, help organize these resources so that they are easy to find and understand for new comers. See how to Contribute for tips!

-
- -

The creators and maintainers of this list do not receive and should not receive any form of payment to accept a change made by any contributor.
-The goal of this repo is to index open-source projects, not to advertise for profit.

-

All the links are monitored and tested with awesome_bot made by @dkhamsing

-

Contents

- -

Legend

- -

What is Docker

-
-

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud.

-
-

Source: What is Docker

-

Where to start

- -

Cheatsheets by

- -

Where to start (Windows)

- -
-

Projects

-

Moby = open source development

-

Docker CE = free product release based on Moby

-

Docker EE = commercial product release based on Docker CE.

-

Docker EE is on the same code base as Docker CE, so also built from Moby, with commercial components added, such as "docker data center / universal control plane"

- -

Container Operations

-

Container Composition

- -

Deployment and Infrastructure

- -

Monitoring

- -

Networking

- -

Orchestration

- -

PaaS

- -

Reverse Proxy

- -

Security

- -

Service Discovery

- -

Volume Management / Data

- -

User Interface

-

Desktop

-

Native desktop applications for managing and montoring docker hosts and clusters

- -

Terminal

- -

Web

- -

Docker Images

-

Base Tools

-

Tools and applications that are either installed inside containers or designed to be run as a sidecar

- -

Builder

-

Applications designed to help or simplify building new images

- -

Dockerfile

- -

Examples by:

- -

Linter

- -

Metadata

- -

Registry

-

Services to securely store your Docker images.

- -

Development with Docker

-

API Client

- -

CI/CD

- -

Development Environment

- -

Garbage Collection

- -

Serverless

- -

Testing

- -

Wrappers

- -

Services based on Docker (💲)

-

CI Services

- -

CaaS

- -

Monitoring Services

- -

Useful Resources

- -

Blogs by

- -

Awesome Lists

- -

Good Tips

- -

Raspberry Pi & ARM

- -

Security

- -

Videos

- -

Communities and Meetups

-

Brazilian

- -

Chinese

- -

English

- -

Russian

-
- - - - - - \ No newline at end of file diff --git a/website/index.tmpl b/website/index.tmpl deleted file mode 100644 index e011798..0000000 --- a/website/index.tmpl +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - Awesome-docker - - - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/website/index.tmpl.html b/website/index.tmpl.html new file mode 100644 index 0000000..ae17cf4 --- /dev/null +++ b/website/index.tmpl.html @@ -0,0 +1,34 @@ + + + + + + + + Awesome-docker + + + + + + + + + + + +
+ + + + + + \ No newline at end of file