industries: serve /industries/ from Nuxt - #5781
Conversation
✅ Deploy Preview for flowfuse-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2ba9434 to
8bb0d09
Compare
2f725b3 to
c133695
Compare
c133695 to
41b2821
Compare
41b2821 to
cfa2b0c
Compare
|
Rebased on
From the review pass over the whole migration:
|
cfa2b0c to
094e3a7
Compare
|
Rebased onto |
094e3a7 to
12157c2
Compare
|
@dimitrieh could you please remove the following pages:
|
|
@Yndira-E can you elaborate? aren't these live on FlowFuse.com. I'd expect these to be an artifact from marketing? 🤔 |
|
@dimitrieh the decision was made by Joyce today during the marketing meeting. I was going to create a PR myself but since you have this one open, it makes more sense to implement it here directly instead of duplicating efforts. |
There was a problem hiding this comment.
@dimitrieh same as the other PRs, please remove these siteArt files
There was a problem hiding this comment.
Removed siteArt.ts, SiteArt.vue and gen-site-art.mjs. They had no call sites at all on this branch and are not on main, so they would have landed as dead code.
| // Top-level routes still on 11ty, not yet ported to Nuxt (everything not listed above | ||
| // already falls through to the 11ty proxy by default). Remove entries here as they migrate: | ||
| // /about, /blueprints, /careers, /community, /events | ||
| // /free-consultation, /industries, /landing, /node-red, /partners, /platform, |
There was a problem hiding this comment.
Added /industries to NUXT_PREFIXES.
| urls: [ | ||
| ...blogAuthorRoutes.map(loc => ({ loc, priority: 0.6 })), | ||
| // /vs/<slug>/ is one [slug].vue over a `data` collection, so the module's | ||
| // static-route discovery cannot see it and content-urls.get.ts cannot either | ||
| // (it keys on `path`, which a data collection has no equivalent of). The three | ||
| // pages left sitemap-legacy.xml when their .njk files were deleted, so without | ||
| // this they are in neither sitemap. | ||
| ...collectSlugRoutes(join(__dirname, 'content/vs'), '/vs').map(loc => ({ loc })), | ||
| ], | ||
| urls: [ | ||
| ...blogAuthorRoutes.map(loc => ({ loc, priority: 0.6 })), | ||
| // /industries/<slug>/ is one [slug].vue over a `data` collection, so the | ||
| // module's static-route discovery cannot see it, and content-urls.get.ts cannot | ||
| // either (it keys on `path`, which a data collection has no equivalent of). | ||
| // Without this the seven pages are in neither sitemap, having left | ||
| // sitemap-legacy.xml when their .md files moved. /industries/automotive/ has its | ||
| // own .vue file, so that one is discovered normally. | ||
| ...collectSlugRoutes(join(__dirname, 'content/industries'), '/industries').map(loc => ({ loc })), | ||
| ], | ||
| exclude: ['/_studio/**', '/api/**'], | ||
| }, |
There was a problem hiding this comment.
Duplicate urls: key — sitemap already has one at line 287 for /vs/. This second one silently overwrites it in the object literal, dropping the /vs/<slug>/ entries from sitemap.xml. Should be merged into one array.
There was a problem hiding this comment.
Good catch, and it was live rather than cosmetic: the second urls: silently overwrote the first in the object literal, so the /vs/<slug>/ entries this PR never touched were being dropped from sitemap.xml. Merged into one array, with the shared blogAuthorRoutes spread kept once.
| @@ -1,44 +1,46 @@ | |||
| --- | |||
| layout: layouts/industry.njk | |||
There was a problem hiding this comment.
Remember to delete the unused layouts
There was a problem hiding this comment.
Deleted industry.njk. No consumers left once src/industries/ went, checked across the other open branches too.
| // The .njk carried these but the layout never read them: it renders the | ||
| // shared Book-a-demo CTA, whose copy and href come from the registry. | ||
| buttonText: z.string().optional(), | ||
| buttonLink: z.string().optional(), |
There was a problem hiding this comment.
maybe drop them instead of carrying dead fields forward?
There was a problem hiding this comment.
Dropped. IndustryCta only declares title and description and renders the shared Book-a-demo button, so they were never read. Gone from the schema and from the seven content files. The vsPages hero keeps its own buttonText/buttonLink, since vs/[slug].vue does read those.
| })) | ||
| // `| sort(false, true, "data.meta.title")`: case-insensitive, ascending. | ||
| return [...fromCollection, AUTOMOTIVE] | ||
| .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase())) |
There was a problem hiding this comment.
Minor: pin the locale. localeCompare(b.title.toLowerCase(), 'en') so sort order doesn't depend on the runtime's default locale (server vs. browser). Same in MatchingUseCases.vue:13.
There was a problem hiding this comment.
Pinned en here and in MatchingUseCases.vue:13. Worth it beyond determinism: the list is sorted once during prerender and again on hydration, so a different default collation in the browser would have been a hydration mismatch.
|
Pushed:
The |
|
Correction to my earlier comment: #5815 is closed, the registration belongs in each migration PR instead. Pushed here. |
|
@dimitrieh this one still hasn't been implemented #5781 (comment) |
9 routes (the listing plus 8 industries) move off 11ty.
The seven pages on layouts/industry.njk were pure frontmatter, so they lift into
an `industries` data collection rendered by pages/industries/[slug].vue through
components/industry/. /industries/automotive/ had its own sections (testimonial
hero, metrics, applications, enterprise, compliance) and stays a hand-written
page; it reuses the one band it shared, the derived use-case grid.
Two icon paths, because the .njk had two:
- Glyphs that went through the navoption/ffIconLg wrappers keep them, via
<NavIcon>, whose registry gained the 11 keys this content names.
- Glyphs the .njk {% include %}d raw become <SiteArt>. Those are drawn on their
own canvases (93x80, 220x220) and take their colour from `currentColor` on the
container, so NavIcon's fixed 24x24 wrapper would crop them and an <img> would
lose the colour.
The problem/solution illustrations were also raw includes, but they are large
standalone diagrams that use no currentColor, so they become public images
served as <img> - which is what the layout's `[&>svg]:max-w-full` was after.
Content strings carrying <strong>, <br> and <span class="text-red-600"> went
through Nunjucks' `| safe`, which printed the whole string unescaped. They go
through nuxt/lib/rich-text.mjs now: escape everything, then re-enable exactly
those three. Anything else a content file puts in a string stays visible text.
Unit tested in nuxt/lib/rich-text.test.mjs.
UseCaseCard gained a `look` prop: industry-use-cases.njk and the /use-cases/
listing rendered the same card with different footer links, and both are kept.
Verified all 9 against production: H1s, heading outline, in-page CTA
destinations and HubSpot form mounts match, with no differences.
The sitemap block had two urls: keys. The second silently overwrote the first in the object literal, so the /vs/<slug>/ entries this PR was not touching were being dropped from sitemap.xml. Merged into one array. SiteArt, its generated util and its generator script had no callers here and are not on main, so they go rather than land unused. cta.buttonText and cta.buttonLink were carried over from the .njk but IndustryCta only takes title and description and renders the shared Book-a-demo button, so they leave the schema and the seven content files with it. industry.njk had no callers left once src/industries/ went. The two title sorts pin 'en' so prerender and hydration agree on the order.
Without the prefix the dev middleware keeps proxying to 11ty, so npm run dev shows the old page. The middleware returns early unless NODE_ENV is development, which is why CI and the deploy preview both looked correct.
363d033 to
38a3cbb
Compare
Marketing retired Aerospace Components, Aviation & Aerospace, Electronics & Appliances, Renewables, Semiconductors, Food & Beverage and Life Sciences. /industries/automotive/ stays. All seven were live and indexed, so the URLs 301 to /industries/ rather than 404ing. Their content, the [slug].vue route that served them, the seven components/industry/ bands, the `industries` collection and its schema, the sitemap and prerender entries and ~40 images all go with them, since the seven .yml files were their only consumers. The header dropdown and the footer group lose the same seven links, so nothing in the chrome points at a redirect. navIcons keeps two of the keys this branch added: /vs/kepware/ and /vs/litmus/ name `arrows-pointing-out` and `link` in content merged with #5783, but neither was ever added to the registry, so NavIcon renders nothing for them on main today. Both pages show one icon fewer than /vs/ignition/ on live. components/use-case/Card.vue goes back to #5780, which adds the same file and is the only branch still using it.
38a3cbb to
7e772bb
Compare
|
Done, all seven are gone. They were live and indexed, so the URLs 301 to Removing the content cascaded, since those seven The header dropdown and the footer group lose the same seven links, so nothing in the chrome points at a redirect. Two things to flag:
|
|
@dimitrieh please resolve the conflicts and merge when it's ready. Thanks! |
# Conflicts: # nuxt/content.config.ts # nuxt/nuxt.config.ts # nuxt/server/middleware/legacy.ts # nuxt/utils/navIcons.ts
|
Conflicts resolved, main is merged in. All six of the remaining migration PRs conflicted on the same two registry files, so this is the union rather than a choice: One thing that only appeared once main came in: #5780 brought Holding off on merging until CI is back. |
# Conflicts: # nuxt/server/middleware/legacy.ts

Description
Moves
/industries/to Nuxt. The seven industry pages were pure frontmatter read by a Nunjucks layout, so they become a content collection plus one[slug].vue;/industries/automotive/keeps its own page because it carries more than the others.Shares
components/use-case/Card.vuewith the/use-cases/PR, whichever lands first.Related Issue(s)
Part of #5777
Checklist