feat: serve a static intro paragraph to crawlers and noscript browsers

The block lives inside #app and is removed right before mount,
since Svelte's mount() appends rather than replaces.
This commit is contained in:
Steffen Becker committed 2026-08-22 11:45:09 +00:00
1 parent 0c420b8765
commit 8ba1fefb62
2 files changed
+16 -1

No files matched your search

+13 -1
View File
@@ -27,7 +27,19 @@
<meta name="theme-color" content="#2f2f31" media="(prefers-color-scheme: dark)" />
</head>
<body>
<div id="app"></div>
<div id="app">
<!-- Static copy for crawlers and noscript; removed in main.ts before the app mounts. -->
<div id="static-intro">
<h1>EdenText — free word processor in your browser</h1>
<p>
EdenText is a web-based, powerful word processor for everything from quick notes to
full-length books. No server, no account — your documents never leave your computer.
It opens and saves real <code>.odt</code> and <code>.docx</code> files, works offline
as a slim browser app, and is free and open source.
</p>
<p><a href="https://github.com/stffnb/edentext">Source code on GitHub</a></p>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
+3
View File
@@ -23,6 +23,9 @@ if (import.meta.env.PROD && 'serviceWorker' in navigator) {
});
}
// Drop the static crawler copy (index.html) — mount() appends instead of replacing
document.getElementById('static-intro')?.remove();
const app = mount(App, { target: document.getElementById('app')! });
export default app;