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 to config #2209

Merged
merged 10 commits into from
Aug 13, 2023
Merged

Add ignored_static to config #2209

merged 10 commits into from
Aug 13, 2023

Conversation

Raymi306
Copy link
Contributor

@Raymi306 Raymi306 commented May 2, 2023

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

Issue #1925
I need to do some manual testing for this yet. EDIT: done

@Raymi306 Raymi306 changed the base branch from master to next May 2, 2023 22:20
@Raymi306
Copy link
Contributor Author

Raymi306 commented May 6, 2023

Finally got around to manual testing, and my code is 100% not ignoring static files 😩
Troubleshooting now. Below is how I set up my manual testing.

ignored_static = ["*ignored*"]
static/
├── folder
│   ├── ignored_2
│   └── regular
├── ignored_1
├── ignored_folder
│   └── regular
├── scripts
│   └── hello.js
└── site.css

edit: Was thankfully a simple fix

@Raymi306 Raymi306 marked this pull request as ready for review May 6, 2023 16:30
@Raymi306
Copy link
Contributor Author

Any feedback on this PR @Keats ?

components/site/src/lib.rs Show resolved Hide resolved
src/cmd/serve.rs Outdated
@@ -475,6 +475,13 @@ pub fn serve(
};

let copy_static = |site: &Site, path: &Path, partial_path: &Path| {
// Do nothing if the file/dir is on the ignore list
println!("{:?}, partial: {:?}", path, partial_path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops! will fix this immediately

src: &Path,
dest: &Path,
hard_link: bool,
gs: &GlobSet,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just pass an Option to copy_directory instead of copying the function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@Raymi306
Copy link
Contributor Author

Raymi306 commented Aug 7, 2023

error: package time-core v0.1.1 cannot be built because it requires rustc 1.65.0 or newer, while the currently active rustc version is 1.64.0 --from Azure

@Keats
Copy link
Collaborator

Keats commented Aug 8, 2023

Don't worry about the pinned version, we can increase it. The errors on the other CI are legit though

@Raymi306
Copy link
Contributor Author

Raymi306 commented Aug 8, 2023

Don't worry about the pinned version, we can increase it. The errors on the other CI are legit though

😬 didn't see the errors were different, will be more thorough next time. Can't believe I forgot to actually build it, I must have been rushing.

Anyway, it builds now, will keep an eye on CI

@Keats Keats merged commit c4341b1 into getzola:next Aug 13, 2023
3 of 5 checks passed
@Keats
Copy link
Collaborator

Keats commented Aug 13, 2023

Thanks!

peterprototypes pushed a commit to peterprototypes/zola that referenced this pull request Sep 12, 2023
* Add ignored_static to config

* Make  handle ignored static files correctly

* cargo fmt

* Match on relative path rather than incorrect target path

* path -> partial path for serve static ignore

* remove debug println

* copy static directory if there is no ignored globset

* Update docs

* Deduplicate code with additional Option argument

* cargo fmt
technimad pushed a commit to technimad/zola that referenced this pull request Sep 30, 2023
* Add ignored_static to config

* Make  handle ignored static files correctly

* cargo fmt

* Match on relative path rather than incorrect target path

* path -> partial path for serve static ignore

* remove debug println

* copy static directory if there is no ignored globset

* Update docs

* Deduplicate code with additional Option argument

* cargo fmt
Keats pushed a commit that referenced this pull request Dec 18, 2023
* Add ignored_static to config

* Make  handle ignored static files correctly

* cargo fmt

* Match on relative path rather than incorrect target path

* path -> partial path for serve static ignore

* remove debug println

* copy static directory if there is no ignored globset

* Update docs

* Deduplicate code with additional Option argument

* cargo fmt
@Jieiku
Copy link
Contributor

Jieiku commented Oct 24, 2024

I opened an issue report for this feature here: #2677

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.

3 participants