Open source  /  Implementation guide

Open-source implementation · Web Design & Development

Design and build a marketing site on open source

What this is. A build-it-yourself path to the same outcome, made from open-source parts you host. It does not publish 5 Kings’ internal method, client data, or any third party’s confidential information — and it says plainly where the open-source path is weaker than a specialist service.

In one paragraph

A marketing site is a design system, a content model and a build pipeline. None of them requires a proprietary page builder. This guide builds the stack that gives you the most control per hour spent: a token-driven design system, a CMS you can query, and a delivery path where every change is reviewable.

What you end up with

  • A token file that is the single source of truth for colour, type, spacing and radius
  • Components built from those tokens, so a brand change is one edit and not 200
  • A content model that survives a redesign without rewriting the copy
  • A build that fails on broken links, missing alt text and accessibility regressions

The reference stack

Every project below is open source and self-hostable. Licences are the ones the project publishes today; check them against your own distribution model before you ship, because a licence can change and an AGPL project has obligations a MIT project does not.

LayerOpen-source projectLicenceWhat it does for you
CMSWordPress (classic or hybrid theme)GPL-2.0Editorial workflow, revisions, roles, REST API, and the largest plugin surface of any CMS.
Static / headlessAstro or EleventyMITWhen the site is mostly content, a static build is faster, cheaper and harder to break. Pair with any headless source.
Design tokensStyle DictionaryApache-2.0One JSON token file generates CSS variables, a JSON theme and any future platform output.
Accessibility + linksaxe-core + lycheeMPL-2.0 / Apache-2.0Automated a11y violations and dead links, failing the build instead of being noted in a report.
Performance budgetLighthouse CIApache-2.0Budgets on JS bytes, LCP and CLS per template, asserted on every commit.
ImagesSharp or ImageMagick + AVIF/WebP pipelineApache-2.0 / ImageMagick licenceResponsive variants with correct dimensions, generated at build so the page never ships a 4000px hero to a phone.
HostingCaddy or nginx + your own VPSApache-2.0 / BSD-2Automatic TLS, HTTP/2, and a config file you can read in a minute.

Build it

1. Write the tokens before the first component

Colour, type scale, spacing scale, radii, shadows, and the two or three semantic pairs that carry meaning (surface, border, brand). Then generate CSS variables from the JSON so the design file and the code cannot drift.

// tokens.json
{ "color": { "brand": { "value": "#f56300" },
             "surface": { "value": "#111418" } },
  "radius": { "md": { "value": "8px" } } }

$ style-dictionary build
# -> build/css/variables.css  (--color-brand: #f56300;)

2. Build components, not pages

A hero, a card, a section header, a CTA block. Each takes content as parameters and renders the same markup everywhere. Page-level CSS is the beginning of the end: after ten pages nobody can safely delete anything.

3. Model content for reuse

Put the durable fields in the CMS (claim, evidence, source, next action, audience) and let templates decide layout. This is what makes a redesign a theme change instead of a content migration.

4. Make the build the quality gate

One command that lints HTML and CSS, runs axe-core, checks links, generates images and enforces budgets. If a change breaks a budget, the build fails. A quality gate that can be skipped is not a gate.

5. Ship images correctly

Generate AVIF and WebP at the sizes your breakpoints use, set width and height on every img, and lazy-load everything below the fold. Most ‘slow site’ problems are image problems wearing a performance costume.

6. Treat accessibility as a build artefact

axe-core in CI catches roughly a third of real issues automatically: contrast, labels, landmarks, heading order. The rest needs a keyboard pass and a screen-reader spot-check on the three most important pages. Do both, and write down what you did not fix.

7. Keep a rollback for every deploy

Deploys are directory swaps or image tags, not in-place edits. If a bad deploy reaches production, the rollback is one command and the previous state is byte-identical.

Acceptance checks

If you cannot verify a claim, it is not a finding. These are the checks that close the work; each one can be run by somebody who did not build it.

Acceptance checkHow to verify it
Every colour and size in the CSS comes from a tokengrep the stylesheet for hex literals and px values outside the token file; the count should trend to zero.
axe-core reports zero critical violations on all templatesCI job per template; failures block merge.
No dead internal or external linkslychee over the built output.
JS payload and LCP are within budget per templateLighthouse CI assertions with the numbers committed in the repo.
Every image has width, height, alt and a modern formatBuild-time check over the generated HTML.
A keyboard user can reach and operate every interactive elementManual pass, recorded once per template and repeated after any component change.

Effort and cost

Estimate
Skill neededIntermediate for a theme; advanced for a headless build with a content pipeline
Build time3–5 days for tokens + components + build gate; one week for a full marketing site
Running costNear zero; static hosting is cheaper than a CMS, and a CMS needs patching and backups
What you must hostStatic: a few dollars a month. WordPress: a 2–4 GB VPS plus backups.

What open source does not give you

The honest half of the comparison. Each of these is a reason somebody buys the service instead of building it, and pretending otherwise would make the rest of this page worthless.

  • This guide does not make design decisions. A token system makes a bad design consistent, which is not the same as good.
  • Automated accessibility tools find a minority of issues. Without a manual keyboard and screen-reader pass you will ship a site that fails real users while passing CI.
  • Static builds need a rebuild on content change. If editors publish hourly, that constraint matters and a hybrid or ISR approach is the honest choice.
  • WordPress’s plugin ecosystem is also its risk surface: every plugin is an update, a licence and a potential vulnerability. Budget for patching, or keep the plugin count near zero.
  • Core Web Vitals field data depends on users’ devices and networks. A perfect lab score can coexist with poor field data.

Scope only, stated so you can compare it with the build above.

  • Information architecture and page-level narrative, which is a positioning decision
  • Implementation inside an existing CMS or platform where a custom stack is not an option
  • Ongoing performance and accessibility regression monitoring with fixes

Sources and further reading

What this page does not include. This guide documents an open-source implementation of the same outcome. It deliberately leaves out 5 Kings’ internal playbooks, client data, vendor terms and unpublished method: we publish what any competent team can reproduce, and we do not publish what belongs to a client or to a contract. Where a step depends on a decision only your business can make, the guide says so instead of guessing.

Take it with you

Design and build a marketing site on open source

The full guide as an A4 PDF: the reference stack with licences, the build steps, the acceptance checks and the honest limits — in one file you can hand to an engineer or print for a planning session.

PDF · A4 · no email required · free to redistribute with attribution

Open-source Guides & PDFs