-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: support cdn url #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean we can rewrite base_url
and cdn_url
in a single rewriting, no need to call rewrite_html_url
multiple times.
pub fn rewrite_html_url(
raw_html: &[u8],
base_url: Option<&str>,
cdn_url: Option<&str>,
) -> Result<Vec<u8>> {
}
Similar to this:
if matches!(current_mode(), Mode::Build) {
rewrite_html_url(&buf, site.get("url"), site.get("cdn"))?;
}
Get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. However, I believe we should remove /static
part from the cdn URL. For example, /static/test.png
should be https://cdn-example.net/test.png
.
Please, Review the commit ad67036 |
Resolve #71