From a88f8202ee7b2f85b4ed172ea34c583779f15dd1 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Wed, 18 Nov 2026 16:53:46 +0100 Subject: [PATCH 1/5] docs: add buyer's guide and hardware pages --- astro.config.mjs | 46 +- package-lock.json | 8 +- package.json | 2 +- scripts/i18n/batches.mjs | 3 +- src/components/CtaButton.astro | 28 +- src/components/ExternalLinks.astro | 9 + src/components/IconBanner.astro | 60 +++ src/components/MobileBreadcrumbs.astro | 9 +- src/components/NavCard.astro | 264 +++++++++- src/components/NavCardGrid.astro | 20 +- src/components/ProductPhoto.astro | 30 ++ src/components/SpecTable.astro | 5 + src/components/Tag.astro | 15 + src/components/TagList.astro | 5 + src/components/lists/VehiclesList.astro | 6 - src/content/docs/en/_intros/_chargers.mdx | 5 + src/content/docs/en/_intros/_heating.mdx | 5 + src/content/docs/en/_intros/_meters.mdx | 5 + .../docs/en/_intros/_smartswitches.mdx | 5 + src/content/docs/en/_intros/_vehicles.mdx | 5 + src/content/docs/en/buyers-guide.mdx | 491 ++++++++++++++++++ src/content/docs/en/index.mdx | 4 +- .../docs/en/installation/considerations.mdx | 130 ----- src/content/docs/en/installation/hardware.mdx | 242 +++++++++ .../installation/hardware/awatt-hems-pro.mdx | 71 +++ .../installation/hardware/awatt-hems-pro.webp | Bin 0 -> 225198 bytes .../hardware/besserladen-node.mdx | 65 +++ .../hardware/besserladen-node.webp | Bin 0 -> 52312 bytes .../en/installation/hardware/ehive-one.mdx | 94 ++++ .../en/installation/hardware/ehive-one.webp | Bin 0 -> 109360 bytes .../installation/hardware/icons/hp-t530.svg | 1 + .../installation/hardware/icons/intel-nuc.svg | 1 + .../installation/hardware/icons/mini-pc.svg | 1 + .../en/installation/hardware/icons/qnap.svg | 1 + .../hardware/icons/synology-ds720-plus.svg | 1 + .../hardware/icons/terramaster-f2-424.svg | 1 + .../hardware/inkvision-energy-box.mdx | 45 ++ .../hardware/inkvision-energy-box.webp | Bin 0 -> 22246 bytes .../installation/hardware/nanopi-zero2.webp | Bin 0 -> 101410 bytes .../installation/hardware/raspberry-pi-4.webp | Bin 0 -> 110334 bytes .../hardware/soluxion-hems-plus.mdx | 82 +++ .../hardware/soluxion-hems-plus.webp | Bin 0 -> 103904 bytes .../hardware/spine-energylink-one.mdx | 102 ++++ .../hardware/spine-energylink-one.webp | Bin 0 -> 69866 bytes src/content/docs/en/installation/index.mdx | 29 +- .../docs/en/installation/linux-image.mdx | 23 +- src/content/i18n/en.json | 3 + src/styles/custom.css | 173 +++++- 48 files changed, 1895 insertions(+), 200 deletions(-) create mode 100644 src/components/ExternalLinks.astro create mode 100644 src/components/IconBanner.astro create mode 100644 src/components/ProductPhoto.astro create mode 100644 src/components/SpecTable.astro create mode 100644 src/components/Tag.astro create mode 100644 src/components/TagList.astro create mode 100644 src/content/docs/en/buyers-guide.mdx delete mode 100644 src/content/docs/en/installation/considerations.mdx create mode 100644 src/content/docs/en/installation/hardware.mdx create mode 100644 src/content/docs/en/installation/hardware/awatt-hems-pro.mdx create mode 100644 src/content/docs/en/installation/hardware/awatt-hems-pro.webp create mode 100644 src/content/docs/en/installation/hardware/besserladen-node.mdx create mode 100644 src/content/docs/en/installation/hardware/besserladen-node.webp create mode 100644 src/content/docs/en/installation/hardware/ehive-one.mdx create mode 100644 src/content/docs/en/installation/hardware/ehive-one.webp create mode 100644 src/content/docs/en/installation/hardware/icons/hp-t530.svg create mode 100644 src/content/docs/en/installation/hardware/icons/intel-nuc.svg create mode 100644 src/content/docs/en/installation/hardware/icons/mini-pc.svg create mode 100644 src/content/docs/en/installation/hardware/icons/qnap.svg create mode 100644 src/content/docs/en/installation/hardware/icons/synology-ds720-plus.svg create mode 100644 src/content/docs/en/installation/hardware/icons/terramaster-f2-424.svg create mode 100644 src/content/docs/en/installation/hardware/inkvision-energy-box.mdx create mode 100644 src/content/docs/en/installation/hardware/inkvision-energy-box.webp create mode 100644 src/content/docs/en/installation/hardware/nanopi-zero2.webp create mode 100644 src/content/docs/en/installation/hardware/raspberry-pi-4.webp create mode 100644 src/content/docs/en/installation/hardware/soluxion-hems-plus.mdx create mode 100644 src/content/docs/en/installation/hardware/soluxion-hems-plus.webp create mode 100644 src/content/docs/en/installation/hardware/spine-energylink-one.mdx create mode 100644 src/content/docs/en/installation/hardware/spine-energylink-one.webp diff --git a/astro.config.mjs b/astro.config.mjs index db2b45ef72..2e8ceb0858 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -65,6 +65,13 @@ export default defineConfig({ format: "directory", }, vite: { + server: { + watch: { + // Locale worktrees and scratch folders hold hundreds of thousands of + // files (full dist builds); watching them makes dev startup take minutes. + ignored: ["**/.worktrees/**", "**/.tmp-*/**"], + }, + }, build: { rolldownOptions: { // Astro injects "use astro:head-inject" into every MDX module; rolldown @@ -90,6 +97,12 @@ export default defineConfig({ "/de/features/external-control": "/de/external-limit", "/en/integrations/home-assistant": "/en/smarthome/home-assistant", "/de/integrations/home-assistant": "/de/smarthome/home-assistant", + ...Object.fromEntries( + LANGS.map((l) => [ + `/${l}/installation/considerations`, + `/${l}/buyers-guide`, + ]), + ), }, integrations: [ mermaid({ @@ -178,14 +191,19 @@ export default defineConfig({ "Supported devices (chargers, meters, vehicles, tariffs) are listed in https://docs.evcc.io/llms-devices.txt.", // Bundles and index stay English; other locales keep their .md routes. exclude: LANGS.filter((l) => l !== "en").map((l) => `${l}/**`), - promote: ["en", "en/installation/**", "en/features/**"], + promote: [ + "en", + "en/installation/**", + "en/buyers-guide", + "en/features/**", + ], demote: ["en/reference/cli/**", "en/media", "en/blog/**"], subsets: [ { label: "Installation", description: - "installing and initial setup on Linux, Raspberry Pi, Docker, Home Assistant, macOS, Windows", - paths: ["en/installation/**"], + "choosing hardware and devices, installing and initial setup on Linux, Raspberry Pi, Docker, Home Assistant, macOS, Windows", + paths: ["en/installation/**", "en/buyers-guide"], }, { label: "Features", @@ -250,12 +268,32 @@ export default defineConfig({ { ...label("installation"), items: [ - { autogenerate: { directory: "installation", collapsed: true } }, + { slug: "installation" }, + { + ...label("hardware"), + collapsed: true, + items: [ + { ...label("overview"), slug: "installation/hardware" }, + { autogenerate: { directory: "installation/hardware" } }, + ], + }, + ...[ + "linux-image", + "docker", + "home-assistant", + "proxmox", + "linux", + "macos", + "freebsd", + "windows", + "configuration", + ].map((page) => ({ slug: `installation/${page}` })), ], }, { ...label("devices"), items: [ + { ...label("buyersGuide"), slug: "buyers-guide" }, { ...label("chargers"), link: "/chargers", diff --git a/package-lock.json b/package-lock.json index 5b5724b901..8cb92ea878 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@astrojs/mdx": "^8.0.3", "@astrojs/sitemap": "^3.7.2", "@astrojs/starlight": "^0.42.2", - "@evcc/icons": "^0.5.11", + "@evcc/icons": "^0.5.15", "astro": "^7.0.6", "astro-mermaid": "^2.0.1", "hast-util-select": "^6.0.4", @@ -1231,9 +1231,9 @@ } }, "node_modules/@evcc/icons": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/@evcc/icons/-/icons-0.5.11.tgz", - "integrity": "sha512-4BgmUtaRtN/vWf15tKr+arffGZqSYk1xSQf1xKI64rHMfBedb4b/nTnvBwyS/2dfpcULmNIWoqYPl1rcPKCwqQ==", + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@evcc/icons/-/icons-0.5.15.tgz", + "integrity": "sha512-0ptcrcikLBB2H5bQrzM+maEHwfVoXABtt3d7yrRYhwgu+vEABw5ItK+UhZ9RXqv82L/D6F/ULtfsCHpuRTl7Lw==", "license": "CC-BY-NC-SA-4.0", "dependencies": { "fuse.js": "^7.1.0" diff --git a/package.json b/package.json index b33d6a52c2..c285c40544 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@astrojs/mdx": "^8.0.3", "@astrojs/sitemap": "^3.7.2", "@astrojs/starlight": "^0.42.2", - "@evcc/icons": "^0.5.11", + "@evcc/icons": "^0.5.15", "astro": "^7.0.6", "astro-mermaid": "^2.0.1", "hast-util-select": "^6.0.4", diff --git a/scripts/i18n/batches.mjs b/scripts/i18n/batches.mjs index becce949dc..a9ce4ed55b 100644 --- a/scripts/i18n/batches.mjs +++ b/scripts/i18n/batches.mjs @@ -31,7 +31,8 @@ const CORE = [ [ "index", "installation/index", - "installation/considerations", + "installation/hardware", + "buyers-guide", "installation/configuration", ], ], diff --git a/src/components/CtaButton.astro b/src/components/CtaButton.astro index e8fb964d77..b20fcde51e 100644 --- a/src/components/CtaButton.astro +++ b/src/components/CtaButton.astro @@ -1,13 +1,22 @@ --- interface Props { - href: string; + /** without a link the button is shown inactive, e.g. for something that is not available yet */ + href?: string; + /** full-size button aligned with the text instead of centred */ + align?: "center" | "start"; } -const { href } = Astro.props; +const { href, align = "center" } = Astro.props; +// links that leave the docs, e.g. to a shop, open in a new tab +const external = href && /^https?:/.test(href) ? { target: "_blank", rel: "noopener" } : {}; --- -
- +
+ {href ? ( + + ) : ( + + )}
diff --git a/src/components/MobileBreadcrumbs.astro b/src/components/MobileBreadcrumbs.astro index 98a60b39dd..b6e9d6baab 100644 --- a/src/components/MobileBreadcrumbs.astro +++ b/src/components/MobileBreadcrumbs.astro @@ -39,11 +39,10 @@ const section: Crumb = isBlog : { label: Astro.locals.t("site.docsLabel"), href: locale ? `/${locale}` : "/" }; const hit = isBlog ? null : find(sidebar, [], null); -const crumbs: Crumb[] = [ - section, - ...(hit ? [...hit.trail, ...(hit.href === path ? [] : [{ label: hit.label, href: hit.href }])] : []), - ...(path === section.href ? [] : [{ label: entry.data.title }]), -]; +const trail: Crumb[] = hit ? [...hit.trail, ...(hit.href === path ? [] : [{ label: hit.label, href: hit.href }])] : []; +// a group named like its overview page would show the same label twice +if (trail.at(-1)?.label === entry.data.title) trail.pop(); +const crumbs: Crumb[] = [section, ...trail, ...(path === section.href ? [] : [{ label: entry.data.title }])]; const last = crumbs.length - 1; --- diff --git a/src/components/NavCard.astro b/src/components/NavCard.astro index 3a1352c12f..759727e5fd 100644 --- a/src/components/NavCard.astro +++ b/src/components/NavCard.astro @@ -1,42 +1,124 @@ --- +import { Image } from "astro:assets"; +import type { ImageMetadata } from "astro"; +import { deviceIconSvg } from "@utils/deviceIcon"; + interface Props { title: string; + /** with a link the whole card is clickable, without one it is a plain tile */ href?: string; to?: string; description?: string; icon?: string; + /** check mark next to the title, for checklist tiles */ + check?: boolean; + /** x mark next to the title, for things that do not work */ + cross?: boolean; + /** info mark next to the title, for things to be aware of */ + info?: boolean; + image?: ImageMetadata; + /** manufacturer website, shown as a text link at the end of the card */ + site?: string; + /** icon shown like a photo: an evcc device icon as "/", e.g. "chargers/go-e-charger-gemini", or the markup of an SVG file imported with ?raw */ + deviceIcon?: string; + /** flatter plate, for a picture that is much wider than tall */ + wide?: boolean; + /** several device icons shown together on the plate, for a card that stands for a group */ + deviceIcons?: string[]; fullWidth?: boolean; highlight?: boolean; } -const { title, href, to, description, icon, fullWidth = false, highlight = false } = Astro.props; -const target = href ?? to ?? "#"; +const { title, href, to, description, icon, check = false, cross = false, info = false, image, deviceIcon, deviceIcons, wide = false, site, fullWidth = false, highlight = false } = Astro.props; +// a device without an icon of its own gets the generic one of its list +const iconSvgs = await Promise.all( + (deviceIcons ?? (deviceIcon ? [deviceIcon] : [])).map(async (key) => { + if (key.trimStart().startsWith("<")) return key; + const [list = "", slug = ""] = key.split("/"); + return (await deviceIconSvg(list, slug)) ?? (await deviceIconSvg(list, "generic.ext")); + }), +); +const target = href ?? to; +const Tag = target ? "a" : "div"; +// links that leave the docs, e.g. to a manufacturer, open in a new tab +const external = target && /^https?:/.test(target) ? { target: "_blank", rel: "noopener" } : {}; const classes = [ "nav-card", fullWidth ? "nav-card-full" : "", highlight ? "nav-card-highlight" : "", + check || cross || info ? "nav-card-check" : "", + cross ? "nav-card-cross" : "", + info ? "nav-card-info" : "", + wide ? "nav-card-wide" : "", ].filter(Boolean).join(" "); --- - - - {description && } - + + {image && ( + + )} + {iconSvgs.length === 1 &&