zola icon indicating copy to clipboard operation
zola copied to clipboard

`ignored_content` does not work

Open savchenko opened this issue 3 years ago • 1 comments

Bug Report

Environment

Zola version: v0.15.3

Expected Behavior

ignored_content = ["*.icc", "readme.*", "README.*"]

Should exclude foobar.icc and README.md.

Current Behavior

Both files are included in the output_dir.

Step to reproduce

Running as following:

base_url = "https://foobar.com"
minify_html = false
output_dir = "_build"
compile_sass = false
build_search_index = false
ignored_content = ["*.icc", "readme.*", "Readme.*", "README.*"]

[slugify]
paths = "safe"
taxonomies = "safe"
anchors = "safe"

[markdown]
highlight_code = false

P.S. While we are at it, can ignored_content support regexp? Would allow much neater ?readme.* and such.

savchenko avatar Jul 16 '22 00:07 savchenko

I've tried with one one of the ignored_content testcase and it seems to work as expected, that's weird.

P.S. While we are at it, can ignored_content support regexp? Would allow much neater ?readme.* and such.

ignored_content are globs so we support whatever https://docs.rs/globset/latest/globset/ is supported, not planning to add anything else.

Keats avatar Jul 16 '22 21:07 Keats

Any updates?

Keats avatar Jan 12 '23 22:01 Keats

Re-tested with v0.16.1 on Win10 and Debian 11 running on WSL2.

File ./static/img/README.md is copied to ./public/img/README.md after zola build.

Config file:

base_url = "http://localhost/"
ignored_content = ["*.icc", "readme.*", "Readme.*", "README.*"]
compile_sass = false
build_search_index = false

[markdown]
highlight_code = false

savchenko avatar Jan 12 '23 23:01 savchenko

Ah ignored_content is only applied in the content directory, not in static

Keats avatar Jan 13 '23 10:01 Keats

Wouldn't it make sense to use it for both locations?

savchenko avatar Jan 13 '23 10:01 savchenko

It was initially meant to not include some files that are artifacts of building pages (like notes or whatever). I don't think it makes sense to have it filter the static folder which has always been "just copy all the content in there"

Keats avatar Jan 13 '23 11:01 Keats

OK, can it be made optional? Plenty of use-cases where certain content in /static is useful during development/build and unnecessary in production.

savchenko avatar May 02 '23 05:05 savchenko

It would be a new config variable, ignored_content does refer to the content directory. ignore_static?

Keats avatar May 02 '23 11:05 Keats

Perfect.

savchenko avatar May 02 '23 17:05 savchenko

I will work on this one.

Raymi306 avatar May 02 '23 22:05 Raymi306

Sorry to nag, but with #2209 merged, is there anything left to do? Can this issue be closed?

csditchfield avatar Jan 27 '24 23:01 csditchfield