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

html5.js 404 for IE #1372

Closed
max-arnold opened this issue Jul 29, 2014 · 5 comments
Closed

html5.js 404 for IE #1372

max-arnold opened this issue Jul 29, 2014 · 5 comments
Assignees
Milestone

Comments

@max-arnold
Copy link
Contributor

Got several 404s for html5.js in access.log. The following snippet

    %if use_cdn:
        <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    %else:
        <!--[if lt IE 9]><script src="/assets/js/html5.js"></script><![endif]-->
    %endif

is expanded as

        <!--[if lt IE 9]><script src="/assets/js/html5.js"></script><![endif]-->

with BASE_URL = "http://example.com/blog/" and USE_CDN = False. Expected path should be http://example.com/blog/assets/js/html5.js.

@Kwpolska Kwpolska added the bug label Jul 29, 2014
@Kwpolska Kwpolska added this to the v7.0.2 milestone Jul 29, 2014
@da2x
Copy link
Contributor

da2x commented Jul 29, 2014

Out of interest, why aren’t coments processed?

@Kwpolska
Copy link
Member

Because why would they be? Usually, HTML comments are supposed to be left in as-is, someone might expect to see an exact thing there. Or, they should be removed. But changing it makes no sense. lxml does not see this as a <script> tag, just a comment containing something that it should not care about in the slightest.

@max-arnold
Copy link
Contributor Author

Maybe explicit jinja context variable is the way to fix this?

 <!--[if lt IE 9]><script src="{{ BLOG_PREFIX }}/assets/js/html5.js"></script><![endif]-->

@Kwpolska
Copy link
Member

We do not have a BLOG_PREFIX variable, we have a link replacement facility though.

https://github.com/getnikola/nikola/blob/master/nikola/nikola.py#L799

With some work, we can make it use that.

@Kwpolska Kwpolska self-assigned this Jul 31, 2014
Kwpolska added a commit that referenced this issue Jul 31, 2014
fix #1372 -- make html5.js (for old IE) work outside of /
@max-arnold
Copy link
Contributor Author

I can confirm that this patch fixes the issue. Thanks, Chris!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants