fix(hosting): propagate preview token in nav links + enrich pages with scraped content
Preview token propagation: - JavaScript in storefront base.html appends _preview query param to all internal links when in preview mode, so clicking nav items (Services, Contact, etc.) preserves the preview bypass Scraped content enrichment: - POC builder now appends first 5 scraped paragraphs to about/services/ projects pages, so the POC shows actual content from the prospect's site instead of just generic template text - Extracts tagline from second scraped heading Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -220,6 +220,22 @@
|
||||
<a href="https://hostwizard.lu" style="color:white;text-decoration:none;padding:6px 16px;border:1px solid rgba(255,255,255,0.4);border-radius:6px;font-size:13px;" target="_blank">hostwizard.lu</a>
|
||||
</div>
|
||||
<style>header { margin-top: 48px !important; }</style>
|
||||
<script>
|
||||
// Propagate preview token to all internal links
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var token = params.get('_preview');
|
||||
if (!token) return;
|
||||
document.querySelectorAll('a[href]').forEach(function(a) {
|
||||
var href = a.getAttribute('href');
|
||||
if (href && (href.startsWith('/') || href.startsWith(window.location.origin)) && !href.startsWith('//')) {
|
||||
var url = new URL(href, window.location.origin);
|
||||
url.searchParams.set('_preview', token);
|
||||
a.setAttribute('href', url.pathname + url.search);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{# Mobile menu panel #}
|
||||
|
||||
Reference in New Issue
Block a user