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

Fix: "head" element order #12375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon-48x48.png" />
<title>MDN Web Docs</title>
<link rel="icon" href="/favicon-48x48.png" />
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion kumascript/src/live-sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const LIVE_SAMPLE_HTML = `
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title><%= sampleTitle %></title>
<style>
body {
padding: 0;
Expand Down Expand Up @@ -49,7 +50,6 @@ const LIVE_SAMPLE_HTML = `
<%- css %>
</style>
<% } %>
<title><%= sampleTitle %></title>
<% if (hasMathML) { %>
<link rel="stylesheet" href="https://fred-wang.github.io/MathFonts/STIX/mathfonts.css" />
<script src="https://fred-wang.github.io/mathml.css/mspace.js"></script>
Expand Down
56 changes: 27 additions & 29 deletions ssr/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,38 @@ export default function render(
renderToString(
<html lang={DEFAULT_LOCALE} prefix="og: https://ogp.me/ns#">
<head>
<meta charSet="utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>{realPageTitle || "MDN Web Docs"}</title>

<link rel="icon" href={favicon} />
<style
media="print"
dangerouslySetInnerHTML={{
__html: printCSS,
}}
/>
{ASSET_MANIFEST.entrypoints.map((url) =>
url.endsWith(".css") ? (
<link href={`/${url}`} rel="stylesheet" />
) : null
)}
{WEBFONT_URLS.map((url) => (
<link
rel="preload"
as="font"
type="font/woff2"
href={url}
crossOrigin=""
/>
))}
{GTAG_PATH && <script src={GTAG_PATH} defer />}
{ASSET_MANIFEST.entrypoints.map((url) =>
url.endsWith(".js") ? <script defer src={`/${url}`} /> : null
)}

<link rel="icon" href={favicon} />
<link rel="apple-touch-icon" href={appleIcon} />

<meta name="theme-color" content="#ffffff" />

<link rel="manifest" href={manifest} />

<link
Expand All @@ -175,17 +198,7 @@ export default function render(
title="MDN Web Docs"
/>

<title>{realPageTitle || "MDN Web Docs"}</title>
{translations}
{WEBFONT_URLS.map((url) => (
<link
rel="preload"
as="font"
type="font/woff2"
href={url}
crossOrigin=""
/>
))}
<link
rel="alternate"
type="application/rss+xml"
Expand Down Expand Up @@ -229,21 +242,6 @@ export default function render(
<meta name="twitter:creator" content="MozDevNet" />

{!pageNotFound && <link rel="canonical" href={canonicalURL} />}
<style
media="print"
dangerouslySetInnerHTML={{
__html: printCSS,
}}
/>
{GTAG_PATH && <script src={GTAG_PATH} defer />}
{ASSET_MANIFEST.entrypoints.map((url) =>
url.endsWith(".js") ? <script defer src={`/${url}`} /> : null
)}
{ASSET_MANIFEST.entrypoints.map((url) =>
url.endsWith(".css") ? (
<link href={`/${url}`} rel="stylesheet" />
) : null
)}
</head>

<body>
Expand Down
Loading