JuliaLang / www.julialang.org

Julia Project website
https://julialang.org
Other
364 stars 447 forks source link

Homepage does not serve valid html #2006

Open LilithHafner opened 10 months ago

LilithHafner commented 10 months ago

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

LilithHafner commented 10 months ago

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

StefanKarpinski commented 10 months ago

cc @tlienart

tlienart commented 9 months ago

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

https://github.com/JuliaLang/www.julialang.org/blob/c35d1b42090ce631a46a221996446d3ecc9c6700/.github/workflows/deploy.yml#L61

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). https://github.com/JuliaLang/www.julialang.org/pull/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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

fonsp commented 9 months ago

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

See https://github.com/tlienart/Franklin.jl/issues/836#issuecomment-975583141 and https://github.com/tlienart/Franklin.jl/discussions/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 🙈