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

Homepage does not serve valid html #2006

Open
LilithHafner opened this issue Jan 2, 2024 · 7 comments
Open

Homepage does not serve valid html #2006

LilithHafner opened this issue Jan 2, 2024 · 7 comments
Labels

Comments

@LilithHafner
Copy link
Member

curl https://www.julialang.org | grep "</html>", for example, reveals that the html tag is never closed.

@LilithHafner
Copy link
Member Author

Other problems: https://validator.w3.org/nu/?doc=https%3A%2F%2Fjulialang.org%2F (maybe these are Franklin.jl bugs?)

@StefanKarpinski
Copy link
Member

cc @tlienart

tlienart added a commit that referenced this issue Jan 11, 2024
The minifier that Franklin leans on is buggy and, in any case, github pages optimises stuff for us so it's not needed.

In the context of #2006, it will help to disable it to see the generated HTML more clearly.
@tlienart
Copy link
Contributor

tlienart commented Jan 11, 2024

the landing page is actually not really handled by Franklin that much, the source of that page is mostly plain HTML https://github.com/JuliaLang/www.julialang.org/blob/main/index.html

there are things that are off though, that </html> is in the source and gets eaten up, I suspect it's the minifier that's not working well here (not a Franklin thing per se and can be disabled).

First thing that can be done would be to disable the minifier by changing

Franklin.optimize(prerender=true);

to

Franklin.optimize(prerender=true, minify=false);

this will have no impact other than un-garbling the HTML (which won't serve any slower as GH pages optimises things for us). #2013

I'll take a look at the rest when I can, some of these errors are simple to handle like the meta tag with name duplication (can be fixed https://github.com/JuliaLang/www.julialang.org/blob/main/_layout/meta.html)

Edit yeah so removing the minifier helps, the </html> is now there: https://github.com/JuliaLang/www.julialang.org/blob/gh-preview/previews/PR2013/index.html

@fredrikekre
Copy link
Member

The closing html tag being removed is most likely on purpose since it is an optional tag, see https://www.w3.org/TR/2014/REC-html5-20141028/syntax.html#optional-tags

@LilithHafner
Copy link
Member Author

Yes. Dropping the closing tag is valid. However, also noting that the tag is present on other pages (e.g. https://www.julialang.org/downloads), that omitting the tag saves very little bandwidth, and that there are other issues that make the html invalid.

@LilithHafner
Copy link
Member Author

Also, I think it's nice to serve valid XML if it's not too much trouble (and xml requires matched tags).

@fonsp
Copy link
Member

fonsp commented Jan 17, 2024

I don't think we need a minifier, since the content is already being gzipped by fastly.

See tlienart/Franklin.jl#836 (comment) and tlienart/Franklin.jl#927: the current minifier has correctness problems and causes more discussion time lost than loading times gained. You might benefit from a modern bundler but the unmaintained minifier that we use (last release 8 years ago) is not helping us 🙈

LilithHafner pushed a commit that referenced this issue Jan 17, 2024
The minifier that Franklin leans on is buggy and, in any case, github pages optimises stuff for us so it's not needed.

In the context of #2006, it will help to disable it to see the generated HTML more clearly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants