fix: caching of FAQ

Fix wrong caching of FAQs for correct generation
This commit is contained in:
webfussel 2025-07-10 10:05:08 +02:00
parent fa0435efdf
commit cffb719a05
2 changed files with 117 additions and 95 deletions

View file

@ -1,33 +1,44 @@
<template>
<section id="services" class="Services content">
<h1>Projekt buchen</h1>
<h2>Paketpreise für <Highlight>feste Ergebnisse</Highlight>.</h2>
<h2>Paketpreise für
<Highlight>feste Ergebnisse</Highlight>
.
</h2>
<p class="margin-top">Manchmal brauchen wir alle einfach nur eine Kleinigkeit und wollen uns nicht lange binden. Das ist natürlich
völlig in Ordnung und genau deshalb biete ich dir die Möglichkeit mich gezielt für <Highlight>kleinere Projekte</Highlight> zu buchen.</p>
<p class="margin-top-small">Hinter diesen Angeboten gibt es <Highlight>keinerlei Abos oder versteckte Kosten</Highlight>.
Aus Transparenzgründen sei aber gesagt, dass sich <Highlight>alle Preise zzgl. 19 % Umsatzsteuer</Highlight> verstehen.</p>
völlig in Ordnung und genau deshalb biete ich dir die Möglichkeit mich gezielt für
<Highlight>kleinere Projekte</Highlight>
zu buchen.
</p>
<p class="margin-top-small">Hinter diesen Angeboten gibt es
<Highlight>keinerlei Abos oder versteckte Kosten</Highlight>
.
Aus Transparenzgründen sei aber gesagt, dass sich
<Highlight>alle Preise zzgl. 19 % Umsatzsteuer</Highlight>
verstehen.
</p>
<FreeInfo />
<FreeInfo/>
<div class="Pricing margin-top">
<article v-for="(service, index) in oneOff" :class="{ 'z-3-all': index === 1, 'z-2-all': index !== 1}">
<header>
<strong>{{service.title}}</strong>
<p class="claim">{{service.smallClaim}}</p>
<strong>{{ service.title }}</strong>
<p class="claim">{{ service.smallClaim }}</p>
<div class="price">
<span v-if="service.price.pre">{{service.price.pre}}</span>
<span>{{typeof service.price.value === 'number' ? intl.format(service.price.value) : service.price.value}}</span>
<span v-if="service.price.post" class="post">{{service.price.post}}</span>
<span v-if="service.price.pre">{{ service.price.pre }}</span>
<span>{{ typeof service.price.value === 'number' ? intl.format(service.price.value) : service.price.value }}</span>
<span v-if="service.price.post" class="post">{{ service.price.post }}</span>
</div>
<div aria-hidden="true" class="bg-icon">
<Icon :name="service.icon" size="1.5em" mode="svg" />
<Icon :name="service.icon" size="1.5em" mode="svg"/>
</div>
</header>
<main>
<div class="list-container">
<ul>
<li v-for="point in service.list">
<Icon class="icon yes" name="ph:caret-circle-double-right-duotone" size="1.5em" mode="svg" />
<Icon class="icon yes" name="ph:caret-circle-double-right-duotone" size="1.5em" mode="svg"/>
<span class="label">{{ point }}</span>
</li>
</ul>
@ -44,7 +55,7 @@
</div>
<div v-if="faq" class="flex-col gap-sm margin-top">
<ContentRenderer :value="faq" :style="{ display: 'contents' }" />
<ContentRenderer :value="faq" :style="{ display: 'contents' }"/>
</div>
</section>
</template>
@ -65,16 +76,16 @@ type Service = {
}
const intl = new Intl.NumberFormat(
'de-DE',
{
style: 'currency',
currency: 'EUR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}
'de-DE',
{
style: 'currency',
currency: 'EUR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
},
)
const oneOff : Service[] = [
const oneOff: Service[] = [
{
title: 'Quick Check',
price: {
@ -129,7 +140,7 @@ const oneOff : Service[] = [
},
]
const { data: faq } = await useAsyncData('faq', () => queryCollection('faq').path('/snippets/faq/booking').first())
const { data: faq } = await useAsyncData('faq_booking', () => queryCollection('faq').path('/snippets/faq/booking').first())
const texts = generatePlainText<['title']>(faq.value?.body.value)
if (faq) {
@ -143,7 +154,7 @@ if (faq) {
'@type': 'Answer',
'text': entity.text,
},
}))
})),
})
}
</script>