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

Some JavaScript assets are being rendered as pages #1194

Closed
ntrrgc opened this issue Apr 11, 2015 · 1 comment
Closed

Some JavaScript assets are being rendered as pages #1194

ntrrgc opened this issue Apr 11, 2015 · 1 comment

Comments

@ntrrgc
Copy link

ntrrgc commented Apr 11, 2015

Create a public JavaScript asset in source, e.g: source/demo/test.js with the following content:

var elem = '<output/>'

If you access the resource in hexo (e.g. http://localhost:4000/demo/test.js) this is the code you will find:

var elem = '<output/>'
</output>

Which is clearly wrong. .js files should never be rendered as pages (and thus mangled on HTML tags). After inspecting Hexo's code I have found there is a skip_render setting to tell Hexo what files should not be rendered but it is empty by default.

As a workaround I have added the following to my _config.yml:

skip_render:
 - '**/*.js'
@leesei
Copy link
Member

leesei commented Apr 11, 2015

See #1119 and #1146.

@leesei leesei closed this as completed Jul 16, 2015
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

No branches or pull requests

2 participants