Skip to content
This repository was archived by the owner on Jul 24, 2022. It is now read-only.
This repository was archived by the owner on Jul 24, 2022. It is now read-only.

Assets cleaner feature #44

@BusinessDuck

Description

@BusinessDuck

This is a feature request.

  1. Some times may be useful to clean empty assets. For example it's may be created by scss (sass) compilation. Or any other hexo plugins may create temp files and doesn't remove it after working. Empty files may be detected by buffer.toString().length === 0 or buffer.length === 0.
  2. Some hexo plugin may produce not empty temporary files or big project may contains unused files, images or legacy script, u know. For large project we cant clean it manually and keep project clean. Concept of this feature looks like: Create a db, and loop each text buffer file and save all used files to map. Then iterate hexo routes and remove all files which one does not exists in map of all used files.

lets create cleaner.js filter with config

cleaner:
  enabled: true
  empty: true
  unused: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions