Fix syntax highlighting and click-to-copy buttons for code blocks (#2049)

pull/2055/head
Kévin Commaille 11 months ago committed by GitHub
parent 6f1e64cb12
commit ba73e0d97a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1 @@
Fix syntax highlighting and click-to-copy buttons for code blocks by purging less CSS.

@ -1,11 +1,21 @@
// Remove unused CSS selectors.
const purgecss = require('@fullhuman/postcss-purgecss')({
// Use stats generated by Hugo.
content: [ './hugo_stats.json' ],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
}
content: [
// Use stats generated by Hugo from HTML content.
'./hugo_stats.json',
// Add used JS scripts.
process.env.HUGO_PUBLISHDIR + '/js/click-to-copy.min.*.js',
process.env.HUGO_PUBLISHDIR + '/js/main.min.*.js',
],
extractors: [
{
extractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
},
extensions: ["json"],
},
],
});
module.exports = {

Loading…
Cancel
Save