Genesis
This commit is contained in:
39
public/index.html
Normal file
39
public/index.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="SeedHeads - Ihr Online-Shop für hochwertige Samen, Pflanzen und Gartenbedarf. Entdecken Sie unser großes Sortiment an Saatgut, Pflanzen und Gartenzubehör für Ihren grünen Daumen.">
|
||||
<base href="/">
|
||||
<title>SeedHeads.de</title>
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
</head>
|
||||
<body style="overflow-y: scroll;">
|
||||
<div id="root"></div>
|
||||
<script>
|
||||
// Get git commit from meta tag
|
||||
window.gitCommit = document.querySelector('meta[name="git-commit"]')?.content || 'unknown';
|
||||
console.log('Git commit:', window.gitCommit);
|
||||
function checkForUpdates() {
|
||||
fetch('/?nocache=' + new Date().getTime())
|
||||
.then(response => response.text())
|
||||
.then(html => {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(html, 'text/html');
|
||||
const metaCommit = doc.querySelector('meta[name="git-commit"]')?.content;
|
||||
|
||||
if (metaCommit && metaCommit !== window.gitCommit) {
|
||||
console.log('New version available (from HTML meta), refreshing...');
|
||||
window.location.reload();
|
||||
}
|
||||
})
|
||||
.catch(error => console.error('Update check via HTML failed:', error));
|
||||
}
|
||||
|
||||
// Check for updates every 5 minutes
|
||||
//setInterval(checkForUpdates, 30 * 1000);
|
||||
// Also check once shortly after page load
|
||||
setTimeout(checkForUpdates, 1000 * 1000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user