mirror of
https://github.com/veggiemonk/awesome-docker.git
synced 2025-11-24 01:14:28 +01:00
Netlify
This commit is contained in:
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();
|
||||
Reference in New Issue
Block a user