File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export default defineNitroPlugin ( nitroApp => {
2+ nitroApp . hooks . hook ( 'render:html' , ( html , { event } ) => {
3+ if ( event . path === '/spa.prerender-fallback.html' ) {
4+ html . head . push ( `
5+ <noscript>
6+ <style>
7+ .noscript-container {
8+ display: flex; flex-direction: column; align-items: center;
9+ justify-content: center; height: 100vh; font-family: sans-serif;
10+ background: #0a0a0a; color: white; text-align: center;
11+ }
12+ .refresh-button {
13+ margin-top: 20px; padding: 12px 24px; background: #444;
14+ color: white; text-decoration: none; border-radius: 6px;
15+ border: 1px solid #666; cursor: pointer;
16+ }
17+ .refresh-button:hover { background: #555; }
18+ </style>
19+ </noscript>
20+ ` )
21+
22+ html . bodyAppend . push ( `
23+ <noscript>
24+ <div class="noscript-container">
25+ <h2>Generating Page...</h2>
26+ <p>This page hasn't been cached yet. Click below to view the content.</p>
27+ <a href="." class="refresh-button">Check for Content</a>
28+ </div>
29+ </noscript>
30+ ` )
31+ }
32+ } )
33+ } )
You can’t perform that action at this time.
0 commit comments