Compare commits

...

8 Commits

Author SHA1 Message Date
Joshua Chen 0423acf493
Merge branch 'main' into slorber/defer-poc 2022-04-08 14:46:29 +08:00
Joshua Chen ddcdc8f69b
Merge branch 'main' into slorber/defer-poc 2022-01-26 16:28:18 +08:00
Josh-Cena a6c678c91b
Fix lock 2021-11-20 17:34:05 +08:00
Josh-Cena f4cc3d3367
Merge branch 'main' into slorber/defer-poc 2021-11-19 09:12:04 +08:00
slorber 3ba0f9875f simply remove all JS scripts :o 2020-08-07 15:01:09 +02:00
slorber 4414e33538 attempt to remove prefetch 2020-08-07 14:44:26 +02:00
slorber 57853616c0 replace script preload with prefetch 2020-08-07 14:18:50 +02:00
slorber c8ef53c670 POC using defer to see if React can be considered as a "progressive enhancement" of a static site that works without JS 2020-08-07 12:48:36 +02:00
2 changed files with 1 additions and 6 deletions

View File

@ -132,6 +132,7 @@ export async function start(
inject: false,
filename: 'index.html',
title: siteConfig.title,
scriptLoading: 'defer',
headTags,
preBodyTags,
postBodyTags,

View File

@ -22,18 +22,12 @@ export default `
<% it.stylesheets.forEach((stylesheet) => { %>
<link rel="stylesheet" href="<%= it.baseUrl %><%= stylesheet %>" />
<% }); %>
<% it.scripts.forEach((script) => { %>
<link rel="preload" href="<%= it.baseUrl %><%= script %>" as="script">
<% }); %>
</head>
<body <%~ it.bodyAttributes %>>
<%~ it.preBodyTags %>
<div id="__docusaurus">
<%~ it.appHtml %>
</div>
<% it.scripts.forEach((script) => { %>
<script src="<%= it.baseUrl %><%= script %>"></script>
<% }); %>
<%~ it.postBodyTags %>
</body>
</html>