Skip to content

Commit 235ad37

Browse files
committed
testing script preload
1 parent 304c88c commit 235ad37

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,18 +2072,22 @@
20722072
<link id="LcpLink" rel="prefetch" href="" as="image" />
20732073
<!-- Begin JAVASCRIPT Section -->
20742074
<script>
2075+
const sDefaultPersonId = 'quincy.acklen';
20752076
function prefetchLargeImage()
20762077
{
20772078
let oStartingPerson = null;
20782079
let sUrl = document.location.hash;
20792080
let sPersonId = sUrl.match( /person=([^&]*)/gi );
2081+
const link = document.getElementById("LcpLink");
20802082
if( sPersonId && sPersonId [ 0 ] )
20812083
{
20822084
sPersonId = sPersonId[ 0 ].replace( 'person=', '' );
2083-
const link = document.getElementById("LcpLink");
2084-
link.href = `photos/${ sPersonId }.webp`
2085-
link.rel = "preload";
20862085
}
2086+
else{
2087+
sPersonId = sDefaultPersonId;
2088+
}
2089+
link.href = `photos/${ sPersonId }.webp`
2090+
link.rel = "preload";
20872091
}
20882092
</script>
20892093

@@ -2161,7 +2165,7 @@
21612165
};
21622166

21632167
let sCurrentPersonId; // you haven't loaded the default person yet!
2164-
const sDefaultPersonId = 'quincy.acklen';
2168+
21652169
let sLastIdNotAdded = null;
21662170
let sLastHash;
21672171

robots.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
User-agent: *
22
Disallow:
33
# Do NOT use in production!
4-
# delete this file and use robots.production.txt as robots.txt in a production environment ( or just add a / --> Disallow: / )
4+
# delete this file and use robots.production.txt as robots.txt in a production environment (or just add a / --> Disallow: / )

0 commit comments

Comments
 (0)