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 dirname of current src file to rewriter function arguments. #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evanminto
Copy link

I wanted to be able to add URL rewriting logic based on the file being processed, so that the task can CND-ify paths relative to the src file rather than relative to the base URL (as is the case for the case where the base option is used). To do this, I wrapped the rewriter function inside the files loop to create a rewriter function that includes the result of calling path.dirname() on the current src file. Since it's the second argument and the first one (url) remains unchanged, this change is fully backwards compatible.

I left the sample image file empty, but that might be confusing. I could replace it with a real image if that's better.

Let me know if any of this doesn't make sense or could be improved.

@XhmikosR
Copy link
Contributor

XhmikosR commented Dec 9, 2016

@evanminto: can you rebase against master? Or enable edit by maintainers in this PR?

@evanminto
Copy link
Author

@XhmikosR Oh, my bad! I checked the "Allow edits from maintainers" button, hope that works.

@XhmikosR
Copy link
Contributor

All right, rebased. @evanminto: please look into the failures.

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.

2 participants