-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Hexo altering Javascript files on generate #1591
Comments
I found another case of an altered .js file - it's also being mangled at a diff public/sketches/circles.js source/sketches/circles.js 146c146,172
< for (num = _i = 0; _i
\ No newline at end of file
---
> for (num = _i = 0; _i <= 100; num = ++_i) {
> _results.push(random_circle());
> }
> return _results;
> })();
> sketch.background(240);
> sketch.frameRate(60);
> sketch.smooth;
> sketch.strokeWeight(1);
> return sketch.fill(150, 50);
> };
> return sketch.draw = function() {
> var c, _i, _len;
> sketch.fill(240, 2);
> sketch.noStroke();
> sketch.rect(0, 0, sketch.width, sketch.height);
> for (_i = 0, _len = circles.length; _i < _len; _i++) {
> c = circles[_i];
> update_circle_position(c);
> }
> return draw_intersections(calculate_intersections(circles));
> };
> };
>
> myp5 = new p5(mysketch);
>
> }).call(this); Attaching as circles.js.txt. |
Basic repro:
The file will be mangled on copy. This happens even if I reduce the package.json file to {
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.1.1"
},
"dependencies": {
"hexo": "^3.0.0",
"hexo-server": "^0.1.2"
}
} |
Out of curiosity, why do you put JS files in the source folder? Also I noticed a |
@PhiLhoSoft: in this case, because they're part of the content, not the template.
Since I have some .js files that are post-specific, they fit the bill. Thanks for the |
Keeping the issue open since there's no clear mention that Hexo would mangle JS files placed elsewhere in assets - not sure if it's a documentation issue or a bug. |
Hexo will transform every file in |
Removed |
My enhancement label was meant for the docs.
|
@leesei If it is a documentation issue, I have raised hexojs/site#581. Will leave stale bot to close it. |
It is also tampering with my .js files:
was changed to
It took me two days to understand what was breaking my pages, finally I had to take diff between my styles and scripts to sort this out. I guess the English docs are somehow confusing. |
I'm closing this issue. Please join the discussion here hexojs/site#581 :) |
On generate, Hexo is altering highlight.pack.js unnecessarily, breaking it.
To reproduce:
hexo generate
You'll see that line 31, which on the original file is
Is converted to:
Installed packages:
I've yet to determine if it's one of the renderers that's causing the issue.
Attaching .js file as a .txt, since Github does not support .js attachments.
highlight.pack.js.txt
The text was updated successfully, but these errors were encountered: