@shopbite-de/storefront 1.29.0 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.env.example +9 -0
  2. package/CLAUDE.md +5 -1
  3. package/app/components/Category/Listing.vue +1 -0
  4. package/app/components/Home/Faq.vue +58 -0
  5. package/app/components/Home/Highlights.vue +1 -0
  6. package/app/components/Product/Card.vue +46 -10
  7. package/app/components/Product/CardDietBadges.vue +7 -13
  8. package/app/components/Product/CrossSelling.vue +18 -2
  9. package/app/components/Product/DeselectIngredient.vue +10 -3
  10. package/app/components/Product/Detail.vue +33 -2
  11. package/app/components/Product/QuickView.vue +20 -1
  12. package/app/composables/useMenuSectionSchema.ts +21 -8
  13. package/app/composables/useProductCrossSelling.ts +1 -0
  14. package/app/composables/useProductQuickView.ts +151 -9
  15. package/app/composables/useRestaurantSchema.ts +40 -3
  16. package/app/composables/useSeoUrlRoute.ts +50 -5
  17. package/app/composables/useShareLink.ts +61 -0
  18. package/app/composables/useTopSellers.ts +4 -1
  19. package/app/composables/useTrackEvent.ts +19 -0
  20. package/app/pages/[...all].vue +38 -10
  21. package/app/pages/index.vue +7 -0
  22. package/app/types/Association.d.ts +2 -0
  23. package/app/utils/product.ts +28 -0
  24. package/app/utils/productUrl.ts +87 -0
  25. package/app/utils/schema.ts +82 -1
  26. package/app/utils/seo.ts +13 -0
  27. package/app/utils/seoPath.ts +13 -2
  28. package/content/index.yml +18 -0
  29. package/content.config.ts +13 -0
  30. package/docs/notes/2026-10-05-issue-289-product-deep-links.md +28 -0
  31. package/docs/notes/2026-10-05-issue-400-menu-item-ingredients-diet.md +18 -0
  32. package/docs/notes/2026-10-05-issue-401-restaurant-schema-ordering.md +21 -0
  33. package/docs/notes/2026-10-05-issue-402-llms-txt.md +17 -0
  34. package/docs/notes/2026-10-05-issue-403-ai-crawlers.md +15 -0
  35. package/docs/notes/2026-10-05-issue-404-faq.md +21 -0
  36. package/docs/notes/2026-10-05-issue-411-quick-view-share.md +22 -0
  37. package/docs/notes/2026-10-06-old-seo-url-redirect.md +30 -0
  38. package/nuxt.config.ts +20 -0
  39. package/package.json +3 -3
  40. package/server/api/listing/[categoryId].get.ts +3 -0
  41. package/server/api/product/[productId]/cross-selling.get.ts +2 -1
  42. package/server/plugins/ai-crawlers.ts +27 -0
  43. package/server/routes/llms.txt.ts +213 -0
  44. package/server/utils/aiCrawlers.ts +79 -0
  45. package/server/utils/llmsTxt.ts +207 -0
  46. package/test/nuxt/HomeFaq.test.ts +34 -0
  47. package/test/nuxt/ProductCrossSelling.test.ts +20 -0
  48. package/test/nuxt/ProductDeselectIngredient.test.ts +34 -0
  49. package/test/nuxt/useSeoUrlRoute.test.ts +88 -5
  50. package/test/nuxt/useShareLink.test.ts +103 -0
  51. package/test/nuxt/useTrackEvent.test.ts +16 -0
  52. package/test/unit/aiCrawlers.spec.ts +48 -0
  53. package/test/unit/llmsTxt.spec.ts +149 -0
  54. package/test/unit/product.spec.ts +20 -0
  55. package/test/unit/productUrl.spec.ts +90 -0
  56. package/test/unit/schema.spec.ts +123 -0
  57. package/test/unit/seo.spec.ts +13 -0
  58. package/test/unit/seoPath.spec.ts +45 -0
  59. package/app/pages/c/[...all].vue +0 -20
  60. package/app/pages/speisekarte/[...all].vue +0 -20
@@ -33,6 +33,12 @@ export type SiteInfo = {
33
33
  cuisine?: string;
34
34
  priceRange?: string;
35
35
  googleBusinessProfileUrl?: string;
36
+ /** Places the shop delivers to, e.g. "63179 Obertshausen" (#401). */
37
+ deliveryAreas?: string[];
38
+ /** Nuxt parses numeric env values into numbers. */
39
+ geo?: { latitude?: number | string; longitude?: number | string };
40
+ /** `true`/`false` or a text such as "Nur telefonisch". */
41
+ acceptsReservations?: boolean | string;
36
42
  address?: {
37
43
  street?: string;
38
44
  postalCode?: string;
@@ -49,11 +55,26 @@ export type MenuSectionInfo = {
49
55
 
50
56
  export type MenuItemInfo = {
51
57
  name: string;
58
+ /** The quick view deep link of the product (#289). */
59
+ url?: string;
52
60
  description?: string;
61
+ /** Main ingredients, the description when the product has none (#400). */
62
+ ingredients?: string[];
63
+ diets?: ("vegetarian" | "vegan")[];
53
64
  image?: string;
54
65
  price?: number;
55
66
  };
56
67
 
68
+ // Vegan dishes are vegetarian too, so they carry both diets.
69
+ const DIET_URLS = {
70
+ vegetarian: ["https://schema.org/VegetarianDiet"],
71
+ vegan: ["https://schema.org/VegetarianDiet", "https://schema.org/VeganDiet"],
72
+ } as const;
73
+
74
+ function buildSuitableForDiet(diets: MenuItemInfo["diets"]) {
75
+ return [...new Set((diets ?? []).flatMap((diet) => DIET_URLS[diet]))];
76
+ }
77
+
57
78
  const formatTime = (time: string) => time.slice(0, 5);
58
79
 
59
80
  /**
@@ -115,6 +136,39 @@ function buildAddress(address: SiteInfo["address"]) {
115
136
  });
116
137
  }
117
138
 
139
+ function buildGeo(geo: SiteInfo["geo"]) {
140
+ const latitude = Number(geo?.latitude || NaN);
141
+ const longitude = Number(geo?.longitude || NaN);
142
+ if (Number.isNaN(latitude) || Number.isNaN(longitude)) return undefined;
143
+ return { "@type": "GeoCoordinates", latitude, longitude };
144
+ }
145
+
146
+ /**
147
+ * Online ordering as an `OrderAction` on the shop (#401): pickup when the
148
+ * shop has an address, own delivery when delivery areas are configured.
149
+ */
150
+ function buildOrderAction(orderUrl: string | undefined, site: SiteInfo) {
151
+ if (!orderUrl) return undefined;
152
+ const deliveryMethod = [
153
+ ...(site.address?.street ? ["https://schema.org/OnSitePickup"] : []),
154
+ ...(site.deliveryAreas?.length
155
+ ? ["http://purl.org/goodrelations/v1#DeliveryModeOwnFleet"]
156
+ : []),
157
+ ];
158
+ return compact({
159
+ "@type": "OrderAction",
160
+ target: {
161
+ "@type": "EntryPoint",
162
+ urlTemplate: orderUrl,
163
+ actionPlatform: [
164
+ "https://schema.org/DesktopWebPlatform",
165
+ "https://schema.org/MobileWebPlatform",
166
+ ],
167
+ },
168
+ deliveryMethod,
169
+ });
170
+ }
171
+
118
172
  /**
119
173
  * The shop as a `Restaurant` (a `LocalBusiness`) with its menu sections.
120
174
  * Empty values are left out, so a shop without address or phone still gets a
@@ -126,6 +180,10 @@ export function buildRestaurantSchema(input: {
126
180
  holidays?: HolidayLike[];
127
181
  menuUrl?: string;
128
182
  menuSections?: MenuSectionInfo[];
183
+ /** Set only when online ordering is enabled. */
184
+ orderUrl?: string;
185
+ paymentMethods?: string[];
186
+ currency?: string;
129
187
  }) {
130
188
  const { site } = input;
131
189
  const openingHours = buildOpeningHoursSpecification(
@@ -148,6 +206,12 @@ export function buildRestaurantSchema(input: {
148
206
  servesCuisine: site.cuisine,
149
207
  priceRange: site.priceRange,
150
208
  address: buildAddress(site.address),
209
+ geo: buildGeo(site.geo),
210
+ areaServed: site.deliveryAreas,
211
+ acceptsReservations: site.acceptsReservations,
212
+ paymentAccepted: input.paymentMethods?.join(", "),
213
+ currenciesAccepted: input.currency,
214
+ potentialAction: buildOrderAction(input.orderUrl, site),
151
215
  sameAs: site.googleBusinessProfileUrl
152
216
  ? [site.googleBusinessProfileUrl]
153
217
  : undefined,
@@ -204,8 +268,10 @@ export function buildMenuSectionSchema(input: {
204
268
  compact({
205
269
  "@type": "MenuItem",
206
270
  name: item.name,
207
- description: item.description,
271
+ url: item.url,
272
+ description: item.description || item.ingredients?.join(", "),
208
273
  image: item.image,
274
+ suitableForDiet: buildSuitableForDiet(item.diets),
209
275
  offers:
210
276
  item.price !== undefined
211
277
  ? {
@@ -222,6 +288,21 @@ export function buildMenuSectionSchema(input: {
222
288
  });
223
289
  }
224
290
 
291
+ /** Questions and answers as a `FAQPage` (#404). */
292
+ export function buildFaqPageSchema(
293
+ items: { question: string; answer: string }[],
294
+ ) {
295
+ return {
296
+ "@context": "https://schema.org",
297
+ "@type": "FAQPage",
298
+ mainEntity: items.map((item) => ({
299
+ "@type": "Question",
300
+ name: item.question,
301
+ acceptedAnswer: { "@type": "Answer", text: item.answer },
302
+ })),
303
+ };
304
+ }
305
+
225
306
  /** Drops `undefined`, empty strings and empty arrays. */
226
307
  function compact<T extends Record<string, unknown>>(object: T): T {
227
308
  return Object.fromEntries(
package/app/utils/seo.ts CHANGED
@@ -54,3 +54,16 @@ export function buildHomeDescription({
54
54
  }
55
55
  return undefined;
56
56
  }
57
+
58
+ /**
59
+ * A comma-separated env value as a list, e.g. the delivery areas (#401).
60
+ * Nuxt parses a JSON array value already.
61
+ */
62
+ export function splitList(value: unknown): string[] {
63
+ if (Array.isArray(value)) return value.map(String);
64
+ if (typeof value !== "string") return [];
65
+ return value
66
+ .split(",")
67
+ .map((entry) => entry.trim())
68
+ .filter(Boolean);
69
+ }
@@ -13,6 +13,11 @@ type SeoPathResolution<T> = { match: T | null; redirectPath?: string };
13
13
  * - The lookup is exact on the trailing slash: `/c/Pizza/` exists, `/c/Pizza`
14
14
  * does not (#291). A miss is retried once with the slash toggled.
15
15
  * - The lookup is case-insensitive, so `/c/pizza/` resolves too (#244).
16
+ * - `resolve` only finds current (canonical) SEO URLs. Shopware keeps the
17
+ * old SEO URL of an entity when the URL template or its name changes;
18
+ * `resolveOld` maps such a path to the current SEO URL, so old links
19
+ * redirect instead of returning 404. It is asked last, with and without
20
+ * the trailing slash, only for paths `resolve` does not know.
16
21
  *
17
22
  * Whenever the match carries a SEO path that differs from the visited path,
18
23
  * `redirectPath` names it, so the visited URL always ends up canonical.
@@ -20,6 +25,7 @@ type SeoPathResolution<T> = { match: T | null; redirectPath?: string };
20
25
  export async function resolveSeoPath<T extends SeoPathMatch>(
21
26
  path: string,
22
27
  resolve: (path: string) => Promise<T | null>,
28
+ resolveOld?: (path: string) => Promise<T | null>,
23
29
  ): Promise<SeoPathResolution<T>> {
24
30
  if (path === "/") return { match: await resolve(path) };
25
31
 
@@ -30,9 +36,14 @@ export async function resolveSeoPath<T extends SeoPathMatch>(
30
36
  ? withoutTrailingSlash(path)
31
37
  : withTrailingSlash(path);
32
38
  const toggledMatch = await resolve(toggledPath);
33
- if (!toggledMatch?.seoPathInfo) return { match: null };
39
+ if (toggledMatch?.seoPathInfo) return withRedirect(path, toggledMatch);
34
40
 
35
- return withRedirect(path, toggledMatch);
41
+ if (!resolveOld) return { match: null };
42
+
43
+ const current = (await resolveOld(path)) ?? (await resolveOld(toggledPath));
44
+ if (!current?.seoPathInfo) return { match: null };
45
+
46
+ return withRedirect(path, current);
36
47
  }
37
48
 
38
49
  function withRedirect<T extends SeoPathMatch>(
package/content/index.yml CHANGED
@@ -114,6 +114,24 @@ mittagstisch:
114
114
  color: neutral
115
115
  variant: subtle
116
116
  trailingIcon: i-lucide-phone
117
+ faq:
118
+ headline: SHOPBITE
119
+ title: Häufige Fragen
120
+ items:
121
+ - question: Wohin liefern Sie?
122
+ answer: Wir liefern nach 63179 Obertshausen (Obertshausen und Hausen) und nach 63165 Mühlheim-Lämmerspiel.
123
+ - question: Was kostet die Lieferung?
124
+ answer: Ab 15 € Bestellwert liefern wir kostenlos. Darunter berechnen wir eine Liefergebühr von 2 €.
125
+ - question: Wie lange dauert die Lieferung?
126
+ answer: Etwa 30 Minuten. Bei der Bestellung können Sie auch eine spätere Lieferzeit wählen.
127
+ - question: Kann ich meine Bestellung abholen?
128
+ answer: Ja, Sie können Ihre Bestellung auch bei uns in der Kantstraße 6 in Obertshausen abholen.
129
+ - question: Wie kann ich bezahlen?
130
+ answer: Bei Lieferung bar, bei Abholung bar oder mit EC-Karte.
131
+ - question: Gibt es vegetarische und vegane Gerichte?
132
+ answer: Ja, vegetarische und vegane Gerichte sind auf der Speisekarte gekennzeichnet.
133
+ - question: Kann ich einen Tisch reservieren?
134
+ answer: Tischreservierungen nehmen wir nur telefonisch entgegen.
117
135
  cta:
118
136
  title: Jetzt bestellen!
119
137
  description: Genieße die italienische Küche, frisch zubereitet und direkt zu dir geliefert oder vor Ort genießen.
package/content.config.ts CHANGED
@@ -88,6 +88,19 @@ export default defineContentConfig({
88
88
  // (#388); the components carry German defaults.
89
89
  menu: createBaseSchema().partial().optional(),
90
90
  highlights: createBaseSchema().partial().optional(),
91
+ // Questions and answers above the call to action, also emitted as
92
+ // FAQPage JSON-LD and in /llms.txt (#404). Plain text answers.
93
+ faq: createBaseSchema()
94
+ .partial()
95
+ .extend({
96
+ items: z.array(
97
+ z.object({
98
+ question: z.string().nonempty(),
99
+ answer: z.string().nonempty(),
100
+ }),
101
+ ),
102
+ })
103
+ .optional(),
91
104
  gallery: createBaseSchema()
92
105
  .extend({
93
106
  images: z.array(
@@ -0,0 +1,28 @@
1
+ # Issue #289: product deep links instead of product pages
2
+
3
+ As of 2026-10-05, branch `feature/289-product-deep-links`. Scope changed with Lirim: no product detail pages (a restaurant product is name, description, price: thin content next to the category page). The quick view deep link `/<category>/?produkt=<number>` is the product URL; its source of truth is the product SEO URL in Shopware, set by the ShopBite plugin (shopware-plugin#28).
4
+
5
+ ## Shopware SEO URL template
6
+
7
+ Lirim's template, verified on the demo (preview API and after indexing):
8
+
9
+ ```twig
10
+ {% set main = product.mainCategories|first %}{% set cat = main ? main.category : product.categories|first %}{% for p in (cat.translated.breadcrumb ?? [])|slice(1) %}{{ p }}/{% endfor %}?produkt={{ product.productNumber|url_encode|raw }}
11
+ ```
12
+
13
+ - `slice(1)` matches the demo's category template (`category.seoBreadcrumb` → `Speisekarte/Pizza/`, incl. slugs such as `Getraenke`); `slice(2)` gives `Pizza/…`, which does not exist. Shops with a prefixed category template (La Fattoria `c/…`) need the prefix: the plugin derives it.
14
+ - The product number must be `|url_encode|raw`: the SEO escaper slugifies variables, `LF-21-groß` became `LF-21-gross`, which the quick view cannot find. Encoded it is `LF-21-gro%C3%9F`, which the router decodes.
15
+ - `seoBreadcrumb`/`seoCategory` are not available in the product template; the preview API renders main products only, so variants are only visible after indexing.
16
+ - **The demo backend now runs this template** (set via Admin API for verification, both `frontend.detail.page` and `store-api.product.detail`, reindexed).
17
+
18
+ ## Implementation
19
+
20
+ - `app/utils/productUrl.ts`: `productDeepLink(product, categoryPath?)` takes the canonical product SEO URL if its query has `produkt`, otherwise category SEO URL + `?produkt=<number>`; `PRODUCT_QUICK_VIEW_PARAM` moved there.
21
+ - Listing (`server/api/listing`), top sellers and `/llms.txt` request `seoUrls` (`seo_url: seoPathInfo, isCanonical`, header `sw-include-seo-urls`).
22
+ - `MenuItem.url` in the category schema, dish links in `/llms.txt`.
23
+ - Product card: with `href`, the name is an `<a>` stretched over the card (`after:absolute after:inset-0`); the article drops `role="button"`/tabindex, the focus ring moves to `has-[a:focus-visible]`. A plain click is prevented and bubbles to the card's `select` (quick view in place, no page load); a modified click opens the link. The wishlist button got `z-10` to stay above the stretched link. Without `href` (e.g. search) the card behaves as before. Top seller cards link only when the product SEO URL is a deep link (no category known on the home page).
24
+ - `useProductQuickView`: a number that is not in the list is loaded in the browser (`readProduct`, `sw-inheritance`), and the quick view opens with it; `ProductDetail` loads the variant id, whose configurator preselects its options.
25
+
26
+ ## Verification
27
+
28
+ Production build against the demo: card `<a href>`s, `MenuItem.url` and `/llms.txt` links (fallback URLs before the template change, SEO URLs after). Playwright on mobile: card click opens the quick view without a page load; Enter on the focused link opens it; Ctrl+click opens a new tab without the quick view; the wishlist button stays clickable; `?produkt=LF-21-gro%C3%9F` opens "Pizza Margherita" with "Groß 40 cm" selected; no console errors. Card look unchanged (link inherits colour, no underline). All unit + nuxt tests, typecheck, ESLint green.
@@ -0,0 +1,18 @@
1
+ # Issue #400: ingredients and diet in the MenuItem schema
2
+
3
+ As of 2026-10-05, branch `feature/400-menu-item-ingredients-diet`. Part of the AI visibility issues #400–#404.
4
+
5
+ ## Finding
6
+
7
+ On www.pizzeria-lafattoria.de, `/c/Pizza/` carried 29 `MenuItem`s, but only 4 had a `description`: the ingredients live in the `Hauptzutaten` property group, not in the product description. No item said whether it is vegetarian or vegan. AI assistants answering "what is on it / is it vegetarian" had nothing to go on.
8
+
9
+ ## Implementation
10
+
11
+ - `buildMenuSectionSchema` takes `ingredients` and `diets` per item. The description falls back to the ingredients joined with ", " when the product has none; a product description always wins.
12
+ - `suitableForDiet`: `VegetarianDiet` for `Vegetarisch: Ja`, `VegetarianDiet` + `VeganDiet` for `Vegan: Ja` (vegan dishes are vegetarian; shops often flag only `Vegan`).
13
+ - `hasYesOption`/`getDiets` moved to `app/utils/product.ts`; `CardDietBadges.vue` uses them, so badges and schema share one rule.
14
+ - No extra request: `sortedProperties` is part of the listing the page loads anyway.
15
+
16
+ ## Verification
17
+
18
+ Production build against the demo backend: `/Speisekarte/Pizza/` 14/14 items with description, 5 with `suitableForDiet`; Salate 5/5 and 2; Nudeln 11/11 and 5. Unit, nuxt tests, typecheck and ESLint green.
@@ -0,0 +1,21 @@
1
+ # Issue #401: ordering, delivery area, geo and payment in the Restaurant schema
2
+
3
+ As of 2026-10-05, branch `feature/401-restaurant-schema-ordering`. Part of the AI visibility issues #400–#404.
4
+
5
+ ## Decisions (agreed with Lirim)
6
+
7
+ - Delivery areas, coordinates and reservations come from `runtimeConfig.public.site` (env), like the address. Moving them to the plugin configuration is #298.
8
+ - Payment methods are read live from the Store API (`readPaymentMethod`, `onlyAvailable`, `includes` in the POST body, #312): one extra request when the home page renders on the server.
9
+
10
+ ## Implementation
11
+
12
+ - `buildRestaurantSchema` adds `geo` (only with both coordinates; env values may be numbers or strings), `areaServed`, `acceptsReservations` (`false` is kept), `paymentAccepted` (names joined with ", "), `currenciesAccepted` and `potentialAction`.
13
+ - `OrderAction` only when the plugin reports `isCheckoutEnabled`. Target is `/speisekarte` (the same URL as `hasMenu`; it redirects to the menu category). `deliveryMethod`: `OnSitePickup` when an address street is set, `DeliveryModeOwnFleet` when delivery areas are set. Shopware shipping methods do not tell pickup and delivery apart (the demo has only `shipping_standard`), so they are not used.
14
+ - `NUXT_PUBLIC_SITE_DELIVERY_AREAS` is comma-separated; a JSON array (parsed by Nuxt) works too.
15
+ - Payment method names are shown as configured in Shopware (demo: "Nachnahme"); shops should name them the way customers say it ("Barzahlung bei Lieferung").
16
+
17
+ ## Verification
18
+
19
+ Production build against the demo backend with the new env variables: the home page `Restaurant` node carries `geo`, both delivery areas, `acceptsReservations: true`, `paymentAccepted: "Nachnahme"`, `currenciesAccepted: "EUR"` and the `OrderAction` with pickup and own delivery. Without the new variables only `paymentAccepted`, `currenciesAccepted` and `potentialAction` (without `deliveryMethod`) are added. Unit + nuxt tests, typecheck, ESLint green.
20
+
21
+ Docs: homepage branch `docs/401-restaurant-schema-ordering` (configuration page, DE/EN), including the note that `NUXT_PUBLIC_SITE_CUISINE` is a cuisine name: La Fattoria sets `italienische`, which produces "italienische in Obertshausen" in its meta description.
@@ -0,0 +1,17 @@
1
+ # Issue #402: /llms.txt
2
+
3
+ As of 2026-10-05, branch `feature/402-llms-txt`. Part of the AI visibility issues #400–#404.
4
+
5
+ ## Implementation
6
+
7
+ - `server/routes/llms.txt.ts` gathers the data, `server/utils/llmsTxt.ts` builds the Markdown (pure, unit-tested). The route lives in the layer, so every shop extending the storefront gets it.
8
+ - Sources: `runtimeConfig.public.site` (name, description, address, phone, cuisine, delivery areas from #401), the ShopBite plugin routes (business hours, holidays, config: checkout enabled, delivery time), `/context` (currency), the menu navigation (`menuCategoryId`, with SEO URLs) and all main products via `/product` (100 per page, at most 10 pages, `includes` in the POST body, #312). Each source is optional: `Promise.allSettled`, a failed request drops its section.
9
+ - Products are grouped by their directly assigned `categoryIds` (extras without category are not listed). Products with variants show "ab <cheapest price>". Ingredients and diets reuse `getMainIngredients`/`getDiets` (#400).
10
+ - Sorting: the `/product` route ignored `sort` by name, so items are sorted in code (German locale, numeric).
11
+ - Content pages come from the `landingpages` collection; pages that `robots.txt` blocks (La Fattoria's legal pages) are filtered with `getPathRobotConfig`.
12
+ - `swr: 3600` route rule. On non-indexable sites the robots module already sends `X-Robots-Tag: noindex, nofollow` for this route, so no own header is needed.
13
+ - `splitList` moved to `app/utils/seo.ts` (shared with `useRestaurantSchema`).
14
+
15
+ ## Verification
16
+
17
+ Production build against the demo backend: `/llms.txt` 200, `text/markdown; charset=utf-8`, 120 lines / 5 KB with 9 menu sections, "ab" prices for pizzas, ingredients and diets; with `NUXT_SITE_INDEXABLE=false` the response carries `X-Robots-Tag: noindex, nofollow`. Unit + nuxt tests, typecheck, ESLint green.
@@ -0,0 +1,15 @@
1
+ # Issue #403: AI crawler policy in robots.txt
2
+
3
+ As of 2026-10-05, branch `feature/403-ai-crawler-robots`. Part of the AI visibility issues #400–#404.
4
+
5
+ ## Implementation
6
+
7
+ - `runtimeConfig.aiCrawlers` (server-only): `search` and `training`, both `true` by default (the previous behaviour, now explicit). Env: `NUXT_AI_CRAWLERS_SEARCH`, `NUXT_AI_CRAWLERS_TRAINING`.
8
+ - `server/plugins/ai-crawlers.ts` hooks `robots:config` of `@nuxtjs/robots` (6.2), which runs at runtime for robots.txt and for the per-request `X-Robots-Tag`. A build-time `robots.groups` entry could not read the env. The hook gets a fresh copy of the configured groups on every call, so pushing groups does not accumulate.
9
+ - `server/utils/aiCrawlers.ts` (pure, unit-tested) builds one group per kind. A crawler matching a named group ignores the `*` group, so an allowed group repeats the `*` disallow paths (La Fattoria's legal pages stay blocked for AI bots too).
10
+ - User agents verified on the operators' pages on 2026-10-05 (sources in the file header). `Google-Extended` and `Applebot-Extended` are control tokens, not crawlers; Google AI Overviews follow Googlebot, not `Google-Extended`.
11
+ - Non-indexable sites (demo) never reach the hook: the module answers with `Disallow: /` before resolving groups.
12
+
13
+ ## Verification
14
+
15
+ Production build against the demo backend: default robots.txt lists both groups with `Allow: /` plus the three disallows; `NUXT_AI_CRAWLERS_TRAINING=false` gives the training group `Disallow: /` and a GPTBot request gets `X-Robots-Tag: noindex, nofollow`; `NUXT_SITE_INDEXABLE=false` keeps the single `Disallow: /`. Unit tests, typecheck, ESLint green.
@@ -0,0 +1,21 @@
1
+ # Issue #404: FAQ section with FAQPage schema
2
+
3
+ As of 2026-10-05, branch `feature/404-faq`. Last of the AI visibility issues #400–#404.
4
+
5
+ ## Decisions
6
+
7
+ - **Data:** optional `faq` (headline, title, description, `items` of question/answer) in the `home` collection (`content/index.yml`), next to the other home sections. Shops without `faq` render nothing; La Fattoria has its own `index.yml`, so nothing changes there until it adds questions.
8
+ - **Place:** home page, above the closing CTA. `/zahlung-und-versand` stays a Markdown page.
9
+ - **Markup:** native `<details>`/`<summary>` instead of `UAccordion`. Reka's accordion unmounts closed panels by default, so the answers would be missing from the SSR HTML that crawlers read; `<details>` keeps them in the markup, is keyboard accessible and adds no JavaScript or Nuxt UI theme (#314, #319).
10
+ - **Answers are plain text** (no Markdown/links), so the same strings work in the HTML, the JSON-LD and `/llms.txt`.
11
+ - Google shows FAQ rich results only for authoritative sites since 2023; the point is AI answers and on-page clarity.
12
+
13
+ ## Implementation
14
+
15
+ - `buildFaqPageSchema` in `app/utils/schema.ts`; `Home/Faq.vue` emits it via `useHead` (key `jsonld-faq`).
16
+ - `/llms.txt` gets a "Häufige Fragen" section after "Bestellen" (`queryCollection(event, "home").select("faq")`).
17
+ - Demo FAQ in `content/index.yml` with the facts from `zahlung-und-versand.md`. Note: the delivery info card in the same file says "darunter 1 € Liefergebühr", the payment page and the FAQ say 2 €.
18
+
19
+ ## Verification
20
+
21
+ Production build against the demo backend: home HTML has 7 `<details>` with all answers and a `FAQPage` node with 7 questions; `/llms.txt` lists them. Screenshots desktop light and mobile dark (via `nuxt-color-mode`, the demo's preference is light): consistent with the other sections, no hydration errors. All unit + nuxt tests (incl. new `HomeFaq.test.ts`), typecheck, ESLint green.
@@ -0,0 +1,22 @@
1
+ # Issue #411: quick view configuration in the URL, share button
2
+
3
+ As of 2026-10-05, branch `feature/411-quick-view-share`.
4
+
5
+ ## Decisions (agreed with Lirim)
6
+
7
+ - Readable parameters next to `produkt`: `ohne` = deselected main ingredients by name, `extras` = selected extras by product number, comma-separated. Unknown entries are ignored. IDs were rejected (long, unreadable links).
8
+ - Live: every change writes the URL with `router.replace` (no history entries); closing removes all three parameters.
9
+ - Share: Web Share API where available, otherwise clipboard + toast "Link kopiert". Icon button in the drawer header (`#actions` slot of `UDrawer`, before close).
10
+
11
+ ## Implementation
12
+
13
+ - `app/utils/productUrl.ts`: parameter names, `parseListParam`, `withQuickViewConfiguration(query, configuration | undefined)` (replaces the three parameters, keeps filters).
14
+ - `useProductQuickView`: a variant switch changes `produkt` to a number that may not be in the list. Without care the drawer would swap its product (and re-mount `ProductDetail`, losing the selection) or load the variant. Numbers the drawer wrote itself are kept in `useState("quick-view-switched-numbers")`; for them the opened product stays. Reset when another product opens or the drawer closes.
15
+ - `useQuickViewConfiguration`: `initial` (parsed from the route) and `update()`; `QuickView.vue` passes `initial` to `ProductDetail`, which hands it to `DeselectIngredient`/`CrossSelling` (read once at setup, emitted immediately so the cart payload and the price include them), and emits `configuration-changed` on ingredient, extras and variant changes.
16
+ - Cross-selling route and `AssociationItemProduct` carry `productNumber`.
17
+ - The header number follows the selected variant (was the opened product's number; visible since variant links, #289).
18
+ - `useShareLink`: `canShare` is set in `onMounted`, so SSR and hydration render the same icon.
19
+
20
+ ## Verification
21
+
22
+ Production build against the demo, Playwright: `?produkt=LF-21-gro%C3%9F&ohne=K%C3%A4se&extras=EXTRA-900,EXTRA-903` opens with Käse deselected, two extras checked, 12,00 € (10 + 2); toggling Tomatensoße appends it to `ohne`; switching to "Normal" sets `produkt=LF-21-normal`, the drawer stays open and keeps the selection; share copies the live URL and shows the toast (headless Chromium has no `navigator.share`); closing removes the parameters without a history entry, back goes to the previous page; no console errors, mobile and desktop. All unit + nuxt tests (new: helpers, initial selection, `useShareLink`), typecheck, ESLint green.
@@ -0,0 +1,30 @@
1
+ # Old category SEO URLs redirect to the current ones
2
+
3
+ As of 2026-10-06, branch `feature/redirect-non-canonical-seo-urls`. Prompted by La Fattoria moving its category URLs from `/c/Pizza/` to `/speisekarte/pizza/` via the Shopware SEO URL template.
4
+
5
+ ## Findings (La Fattoria Store API)
6
+
7
+ - Shopware keeps the old SEO URL of an entity when the template or the entity name changes: same `foreignKey`, `isCanonical: null`. La Fattoria has 262 of them for products already (e.g. `Schnitzel-Wiener-Art/103V` next to the canonical `Schnitzel-Wiener-Art/103`).
8
+ - The Store API `/seo-url` route adds `isCanonical = true` to the criteria unless they contain an `equals` filter on `isCanonical` at top level (a nested `multi` filter does not count). A lookup by `seoPathInfo` alone therefore never finds an old URL: before this change, every old category URL returned 404 after a template change.
9
+
10
+ ## Change
11
+
12
+ - `resolveSeoPath` takes an optional `resolveOld`. It is asked only after the canonical lookup missed with and without the trailing slash, again for both variants, so known paths cost no extra request.
13
+ - `useSeoUrlRoute` implements it as two Store API calls: the old record (`seoPathInfo` + `isCanonical: null`), then the canonical record of the same `foreignKey`, `routeName` and `languageId`. A match redirects with 301 (query kept); an old URL without a current one (deleted category) stays 404.
14
+ - Up to four lookups for unknown paths below `/c/` and `/speisekarte/` (previously two). Other unknown paths go to the content catch-all and are unaffected.
15
+
16
+ ## One catch-all instead of `/c/` and `/speisekarte/`
17
+
18
+ The category pages `pages/c/[...all].vue` and `pages/speisekarte/[...all].vue` were identical and only existed for the two URL prefixes in use. `pages/[...all].vue` now serves both kinds of pages, so the prefix is up to the Shopware SEO URL template:
19
+
20
+ 1. Markdown content page for the path (local, cheap), as before.
21
+ 2. Otherwise `useSeoUrlRoute`, restricted to `frontend.navigation.page`: product SEO URLs have no page (#289) and stay 404, also as old URLs. Technical `/navigation/<id>` paths now redirect to their SEO URL (planned in #244).
22
+ 3. Paths with a file extension (`/wp-login.php`, `/.env`) 404 before step 2, so scanner traffic causes no Store API requests.
23
+
24
+ The category bar of the `listing` layout is rendered by the page itself (same markup) instead of switching layouts per result, which would need `setPageLayout` during SSR (hydration warning in Nuxt). A category page now costs one extra request to `/api/content/page`.
25
+
26
+ Checked against the La Fattoria backend (dev server): `/c/Pizza/` 200 with 29 products, `/c/pizza` and `/navigation/<pizza id>` 301 to `/c/Pizza/`, `/agb` 200, `/c/Unbekannt/`, `/Schnitzel-Wiener-Art/103`, `/wp-login.php`, `/.env` 404. Client-side navigation content → category → category → alias → content → back renders the right page each time. The hydration warnings on a category page (`NavigationDesktopLeft`, `CategoryListing`) are the same with the old pages.
27
+
28
+ ## Verification
29
+
30
+ Unit tests (`seoPath.spec.ts`, `useSeoUrlRoute.test.ts`), typecheck, ESLint, Prettier. Both queries checked against the La Fattoria Store API with existing old product URLs: the `seoPathInfo` lookup without an `isCanonical` filter returns nothing, with `isCanonical: null` it returns the old record, and the canonical lookup returns `Schnitzel-Wiener-Art/103`.
package/nuxt.config.ts CHANGED
@@ -57,6 +57,12 @@ export default defineNuxtConfig({
57
57
  },
58
58
  apiClientConfig: {},
59
59
  geoapifyApiKey: "",
60
+ // AI crawlers named in robots.txt (#403, server/plugins/ai-crawlers.ts):
61
+ // search = AI search and assistant fetches, training = model training.
62
+ aiCrawlers: {
63
+ search: true,
64
+ training: true,
65
+ },
60
66
  public: {
61
67
  shopBite: {
62
68
  cacheTtl: {
@@ -105,6 +111,15 @@ export default defineNuxtConfig({
105
111
  googleBusinessProfileUrl: "",
106
112
  // Restaurant schema only, e.g. "€€" (#272).
107
113
  priceRange: "",
114
+ // Restaurant schema only (#401): comma-separated delivery areas
115
+ // ("63179 Obertshausen, 63165 Lämmerspiel"), coordinates and
116
+ // "true"/"false" or a text for table reservations.
117
+ deliveryAreas: "",
118
+ geo: {
119
+ latitude: "",
120
+ longitude: "",
121
+ },
122
+ acceptsReservations: "",
108
123
  },
109
124
  storeUrl: "",
110
125
  // Matomo config, runtime-overridable via NUXT_PUBLIC_SCRIPTS_MATOMO_ANALYTICS_*
@@ -121,6 +136,11 @@ export default defineNuxtConfig({
121
136
  },
122
137
 
123
138
  routeRules: {
139
+ // Rebuilt at most hourly: hours, closing days and the menu change rarely
140
+ // (#402).
141
+ "/llms.txt": {
142
+ swr: 3600,
143
+ },
124
144
  "/merkliste": {
125
145
  ssr: false,
126
146
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopbite-de/storefront",
3
- "version": "1.29.0",
3
+ "version": "1.31.0",
4
4
  "main": "nuxt.config.ts",
5
5
  "description": "Shopware storefront for food delivery shops",
6
6
  "keywords": [
@@ -24,7 +24,7 @@
24
24
  "@iconify-json/simple-icons": "^1.2.97",
25
25
  "@nuxt/content": "3.16.1",
26
26
  "@nuxt/image": "^2.1.0",
27
- "@nuxt/scripts": "1.3.9",
27
+ "@nuxt/scripts": "1.3.12",
28
28
  "@nuxt/ui": "^4.11.2",
29
29
  "@nuxtjs/robots": "^6.2.3",
30
30
  "@nuxtjs/sitemap": "^8.5.1",
@@ -55,7 +55,7 @@
55
55
  "@typescript-eslint/eslint-plugin": "^8.70.1",
56
56
  "@typescript-eslint/parser": "^8.70.1",
57
57
  "@vitejs/plugin-vue": "^6.0.9",
58
- "@vitest/ui": "5.0.1",
58
+ "@vitest/ui": "5.0.3",
59
59
  "@vue/compiler-dom": "^3.5.43",
60
60
  "@vue/server-renderer": "^3.5.43",
61
61
  "@vue/test-utils": "^2.5.1",
@@ -17,7 +17,10 @@ const BASE_CRITERIA = {
17
17
  "cover",
18
18
  // "Ausverkauft" on the card (#325).
19
19
  "available",
20
+ // Product deep link (#289); the request sends `sw-include-seo-urls`.
21
+ "seoUrls",
20
22
  ],
23
+ seo_url: ["seoPathInfo", "isCanonical"],
21
24
  property: ["id", "name", "translated", "displayType", "options"],
22
25
  property_group_option: [
23
26
  "id",
@@ -6,7 +6,8 @@ const criteria = {
6
6
  includes: {
7
7
  cross_selling_element: ["crossSelling", "products"],
8
8
  cross_selling: ["name"],
9
- product: ["id", "name", "calculatedPrice", "translated"],
9
+ // productNumber: extras in the quick view URL (#411)
10
+ product: ["id", "productNumber", "name", "calculatedPrice", "translated"],
10
11
  calculated_price: ["unitPrice"],
11
12
  },
12
13
  };
@@ -0,0 +1,27 @@
1
+ import { buildAiCrawlerGroups } from "../utils/aiCrawlers";
2
+
3
+ /**
4
+ * Names the AI crawlers in robots.txt (#403): AI search bots are allowed by
5
+ * default, training bots follow `runtimeConfig.aiCrawlers.training`
6
+ * (NUXT_AI_CRAWLERS_TRAINING=false blocks them). Only runs for indexable
7
+ * sites; a non-indexable site (demo) keeps its single `Disallow: /`.
8
+ */
9
+ export default defineNitroPlugin((nitroApp) => {
10
+ nitroApp.hooks.hook("robots:config", (ctx) => {
11
+ const { aiCrawlers } = useRuntimeConfig(ctx.event);
12
+ const wildcard = ctx.groups.find((group) =>
13
+ [group.userAgent ?? "*"].flat().includes("*"),
14
+ );
15
+ const disallow = [wildcard?.disallow ?? []].flat();
16
+
17
+ ctx.groups.push(
18
+ ...buildAiCrawlerGroups(
19
+ {
20
+ search: aiCrawlers.search !== false,
21
+ training: aiCrawlers.training !== false,
22
+ },
23
+ disallow,
24
+ ),
25
+ );
26
+ });
27
+ });