descriptionYet Another Minifier. Minify and compress html, js, css and svg.
homepage URLhttps://github.com/curbengh/hexo-yam
repository URLhttps://github.com/curbengh/hexo-yam.git
ownercurben@users.noreply.repo.or.cz
last changeSat, 8 Jun 2024 08:11:38 +0000 (8 08:11 +0000)
last refreshSat, 8 Jun 2024 12:21:36 +0000 (8 14:21 +0200)
content tags
add:
README.md

hexo-yam

npm version Build Status codecov NPM Dependencies Known Vulnerabilities

Yet Another Minifier for Hexo. Minify and compress HTML, JS, CSS, SVG, XML and JSON. Other files are also compressed. Support gzip, brotli and zstd compressions.

Table of contents

Installation

$ npm install hexo-yam --save --include=optional --force

Options

minify:
  enable: true
  previewServer: true
  html:
  css:
  js:
  svg:
  gzip:
  brotli:
  xml:
  json:

HTML

minify:
  html:
    enable: true
    exclude:

For more options, see HTMLMinifier.

CSS

minify:
  css:
    enable: true
    exclude:
      - "*.min.css"

For more options, see clean-css.

JS

minify:
  js:
    enable: true
    exclude:
      - "*.min.js"

For more options, see Terser.

SVG

minify:
  svg:
    enable: true
    include:
      - "*.svg"
      - "!*.min.svg"
plugins:
  # Retain comments
  removeComments: false
  # Do not remove unused ID attributes
  cleanupIds: false

XML

Remove whitespaces in xml.

minify:
  xml:
    enable: false
    include:
      - "*.xml"
      - "!*.min.xml"

For more options, see minify-xml.

JSON

Remove whitespaces in json.

minify:
  json:
    enable: false
    include:
      - "*.json"
      - "!*.min.json"

Gzip

minify:
  gzip:
    enable: true
    include:
      - "*.html"
      - "*.css"
      - "*.js"
      - "*.txt"
      - "*.ttf"
      - "*.atom"
      - "*.stl"
      - "*.xml"
      - "*.svg"
      - "*.eot"
      - "*.json"

Brotli

minify:
  brotli:
    enable: true
    include:
      - "*.html"
      - "*.css"
      - "*.js"
      - "*.txt"
      - "*.ttf"
      - "*.atom"
      - "*.stl"
      - "*.xml"
      - "*.svg"
      - "*.eot"
      - "*.json"

Zstd

minify:
  zstd:
    enable: false
    include:
      - "*.html"
      - "*.css"
      - "*.js"
      - "*.txt"
      - "*.ttf"
      - "*.atom"
      - "*.stl"
      - "*.xml"
      - "*.svg"
      - "*.eot"
      - "*.json"

Cannot find module '@mongodb-js/zstd-linux-x64-gnu'

npm install --include=optional --force

Globbing

Use "globOptions" to customise how glob patterns match files. Refer to micromatch for available options.

exclude:
  - "*foo.html" # basename is enabled
  - "**/bar/*/*.html" # basename is automatically disabled
  - "*baz.css" # basename is enabled
globOptions:
  basename: true # default
include:
  - "!foo.svg"
  - "!**/bar/*/*.svg"
globOptions:
  basename: true

Credits

All credits go to the following work:

shortlog
5 hours ago MDLeombuild(npm): --force flag to install optional depsmaster
5 hours ago MDLeomdocs: reorder sections
26 hours ago Ming Di LeomMerge pull request #157 from curbengh/previewServer
27 hours ago Ming Di LeomMerge pull request #158 from curbengh/zstd
28 hours ago MDLeomdocs(zstd): --force flag to install optional depszstd
2 days ago MDLeomtest: include optional deps
2 days ago MDLeomfeat: zstd compression
3 days ago MDLeomfeat: previewServer optionpreviewServer
3 days ago Ming Di LeomMerge pull request #155 from curbengh/dependabot/github...
3 days ago MDLeomci(codecov): add upload token
3 days ago MDLeomtest: node 22
4 days ago MDLeomtest: node 22
2024-02-01 dependabot... chore(deps): bump codecov/codecov-action from 3 to 4
2024-01-28 Ming Di LeomMerge pull request #150 from curbengh/dependabot/github...
2024-01-28 Ming Di LeomMerge pull request #149 from curbengh/dependabot/github...
2024-01-28 Ming Di LeomMerge pull request #145 from curbengh/dependabot/github...
...
tags
18 months ago v8.0.0
2 years ago v7.0.0
2 years ago v6.0.0
3 years ago v5.0.0
3 years ago v4.2.0
4 years ago v4.1.0
4 years ago v4.0.0
4 years ago v3.2.3
4 years ago v3.2.2
4 years ago v3.2.1
4 years ago v3.2.0
4 years ago v3.1.0
4 years ago v3.0.0
4 years ago v2.2.1
4 years ago v2.2.0
4 years ago v2.1.1
...
heads
5 hours ago master
28 hours ago zstd
3 days ago previewServer
18 months ago 8.0
19 months ago swc
5 years ago upstream