Skip to content

[NEW FEATURE] Skip files - #12

Open
spart4ck wants to merge 2 commits into
pelican-plugins:mainfrom
spart4ck:skip-files
Open

[NEW FEATURE] Skip files#12
spart4ck wants to merge 2 commits into
pelican-plugins:mainfrom
spart4ck:skip-files

Conversation

@spart4ck

Copy link
Copy Markdown

What has been added

I have added a couple of lines in addition of a method that does the following:

  1. Exclude for minification any file (html, css or js) that is already minified. Just with a verification if the name contain .min.
  2. Exclude for minification any file or path based in an array set by the user in pelican configuration. It verify if the names or paths contains the excluded text, it isn't a == comparison.
  3. Improve loggin text in debug mode

New variables

The new variables available would be

MINIFY_SKIP_FILES = ["example1", "example2"] 
MINIFY_SKIP_ALREADY_MINIFIED = True/False 

MINIFY_SKIP_FILES -> array of strings
MINIFY_SKIP_ALREADY_MINIFIED-> Default True

Example

Would be possible to exclude entire folders or just names, for example:
MINIFY_SKIP_FILES = ["customcss", "script.js"]

.../output/theme/**customcss/
.../output/theme/customjs/script.js
.../output/theme/customjs/script2.js
  • Path contain customcss: yes
  • Name contain script.js: yes
  • script2.js doesn't contain script.js: so no excluded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant