Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignored_static similar to ignore_content but for the static folder #1925

Closed
savchenko opened this issue Jul 16, 2022 · 11 comments
Closed

Comments

@savchenko
Copy link

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.

@Keats
Copy link
Collaborator

Keats commented Jul 16, 2022

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
Copy link
Collaborator

Keats commented Jan 12, 2023

Any updates?

@savchenko
Copy link
Author

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

@Keats
Copy link
Collaborator

Keats commented Jan 13, 2023

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

@savchenko
Copy link
Author

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

@Keats
Copy link
Collaborator

Keats commented Jan 13, 2023

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"

@savchenko
Copy link
Author

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

@Keats
Copy link
Collaborator

Keats commented May 2, 2023

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

@savchenko
Copy link
Author

Perfect.

@Keats Keats changed the title ignored_content does not work Add ignored_static similar to ignore_content but for the static folder May 2, 2023
@Raymi306
Copy link
Contributor

Raymi306 commented May 2, 2023

I will work on this one.

@csditchfield
Copy link

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

@Keats Keats closed this as completed Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants