mirror of
https://github.com/veggiemonk/awesome-docker.git
synced 2025-04-19 07:28:05 +02:00
Remove ids from links
This commit is contained in:
parent
aca9367c69
commit
c306007594
2 changed files with 4 additions and 19 deletions
18
build.js
18
build.js
|
@ -2,7 +2,6 @@ const fs = require('fs');
|
|||
const showdown = require('showdown');
|
||||
const cheerio = require('cheerio');
|
||||
const Parcel = require('parcel-bundler');
|
||||
const camelCase = require('camelcase');
|
||||
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
|
@ -19,7 +18,7 @@ const includeReadme = ({
|
|||
md = readme,
|
||||
templateHTML = template,
|
||||
dest = merged,
|
||||
}) => {
|
||||
} = {}) => {
|
||||
const converter = new showdown.Converter({
|
||||
omitExtraWLInCodeBlocks: true,
|
||||
simplifiedAutoLink: true,
|
||||
|
@ -48,19 +47,6 @@ const includeReadme = ({
|
|||
console.log('Merging files...');
|
||||
const $ = cheerio.load(indexTemplate);
|
||||
$('#md').append(converter.makeHtml(markdown));
|
||||
$('a').each((i, elem) => {
|
||||
$(elem).attr(
|
||||
'id',
|
||||
camelCase(
|
||||
$(elem)
|
||||
.attr('href')
|
||||
.replace(/\/|\.|:|#/g, ''),
|
||||
{
|
||||
pascalCase: true,
|
||||
},
|
||||
),
|
||||
);
|
||||
});
|
||||
console.log('Writing index.html');
|
||||
fs.writeFileSync(dest, $.html(), 'utf8');
|
||||
console.log('DONE 👍');
|
||||
|
@ -82,7 +68,7 @@ const bundle = (dest = destination) => {
|
|||
};
|
||||
|
||||
const main = () => {
|
||||
includeReadme({});
|
||||
includeReadme();
|
||||
bundle();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue