mirror of
https://github.com/veggiemonk/awesome-docker.git
synced 2025-04-19 07:28:05 +02:00
Netlify
This commit is contained in:
parent
d590e2429f
commit
b1e3a95ba3
13 changed files with 154 additions and 78 deletions
46
build.js
Normal file
46
build.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
const fs = require('fs');
|
||||
const showdown = require('showdown');
|
||||
const cheerio = require('cheerio');
|
||||
const Parcel = require('parcel-bundler');
|
||||
|
||||
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');
|
||||
|
||||
console.log('Loading files...');
|
||||
const index = fs.readFileSync('index.tmpl', 'utf8');
|
||||
const readme = fs.readFileSync('README.md', 'utf8');
|
||||
|
||||
console.log('Merging files...');
|
||||
const $ = cheerio.load(index);
|
||||
$('#md').append(converter.makeHtml(readme));
|
||||
|
||||
console.log('Writing index.html');
|
||||
fs.writeFileSync('index.html', $.html(), 'utf8');
|
||||
|
||||
console.log('Bundling with Parcel.js');
|
||||
console.log('');
|
||||
|
||||
new Parcel('index.html', {
|
||||
name: 'build',
|
||||
publicURL: '/awesome-docker'
|
||||
}).bundle();
|
Loading…
Add table
Add a link
Reference in a new issue