chore: debug
This commit is contained in:
parent
e299fb2ec4
commit
909008d068
1 changed files with 0 additions and 24 deletions
24
.eleventy.js
24
.eleventy.js
|
@ -4,7 +4,6 @@ import lightningCSS from '@11tyrocks/eleventy-plugin-lightningcss'
|
||||||
import markdownIt from 'markdown-it'
|
import markdownIt from 'markdown-it'
|
||||||
import markdownItAnchor from 'markdown-it-anchor'
|
import markdownItAnchor from 'markdown-it-anchor'
|
||||||
import markdownItFootnote from 'markdown-it-footnote'
|
import markdownItFootnote from 'markdown-it-footnote'
|
||||||
import htmlmin from 'html-minifier-terser'
|
|
||||||
import filters from './config/filters/index.js'
|
import filters from './config/filters/index.js'
|
||||||
import { minifyJsComponents } from './config/events/index.js'
|
import { minifyJsComponents } from './config/events/index.js'
|
||||||
import { allContent, popularPosts, searchIndex } from './config/collections/index.js'
|
import { allContent, popularPosts, searchIndex } from './config/collections/index.js'
|
||||||
|
@ -84,29 +83,6 @@ export default async function (eleventyConfig) {
|
||||||
eleventyConfig.addShortcode('appVersion', () => appVersion)
|
eleventyConfig.addShortcode('appVersion', () => appVersion)
|
||||||
eleventyConfig.addShortcode('currentYear', () => DateTime.now().year)
|
eleventyConfig.addShortcode('currentYear', () => DateTime.now().year)
|
||||||
|
|
||||||
// transforms
|
|
||||||
eleventyConfig.addTransform('html-minify', (content, path) => {
|
|
||||||
if (path && path.endsWith('.html')) {
|
|
||||||
return htmlmin.minify(content, {
|
|
||||||
collapseBooleanAttributes: true,
|
|
||||||
collapseWhitespace: true,
|
|
||||||
decodeEntities: true,
|
|
||||||
includeAutoGeneratedTags: false,
|
|
||||||
minifyCSS: true,
|
|
||||||
minifyJS: true,
|
|
||||||
minifyURLs: true,
|
|
||||||
noNewlinesBeforeTagClose: true,
|
|
||||||
quoteCharacter: '"',
|
|
||||||
removeComments: true,
|
|
||||||
sortAttributes: true,
|
|
||||||
sortClassName: true,
|
|
||||||
useShortDoctype: true,
|
|
||||||
processScripts: ['application/ld+json'], // minify JSON-LD scripts
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return content
|
|
||||||
})
|
|
||||||
|
|
||||||
// events
|
// events
|
||||||
eleventyConfig.on('afterBuild', minifyJsComponents)
|
eleventyConfig.on('afterBuild', minifyJsComponents)
|
||||||
|
|
||||||
|
|
Reference in a new issue