Skip to content

About

๐Ÿœ The official haskell-miso.org website

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

70 Commits

Folders and files

Repository files navigation

Image
The miso ๐Ÿœ website.

Features

  • Fully static. A prerender executable (vanilla GHC + miso's ssr flag) renders every route to public/<path>/index.html. The same code compiles to WebAssembly and hydrates whichever page was loaded, then takes over navigation with Miso.Router.
  • One dependency. The site depends on base and miso (plus the directory boot library in the generator). No servant, no aeson, no markdown โ€” the docs are Haskell Views, the syntax highlighter is a small Haskell tokenizer, and JSON/SEO artifacts are printed by hand.
  • Everything is a component. Each page is a keyed Component mounted with (+>); the docs shell receives the current route as props; the language (with a translation table), and the theme live on the app-global context, persisted to localStorage.
  • Readable by LLMs. The generator also writes llms.txt (an index of the docs), llms-full.txt (all of them in one file) and a Markdown copy of each docs page, blog post and the examples page at <path>/index.html.md, rendered from the same Views as the HTML, so they never drift from the site.
  • Live docs. Documentation pages embed running examples next to their source. bun scripts/check-demos.ts verifies the displayed source is exactly the code that executes (see shared/Site/Demos.hs).
  • Checked in CI. Every pull request runs the demo check above and a link check of the built site with lychee (external links, pages, assets and #anchors; settings in lychee.toml). The live site's links are also checked weekly, and failures open a broken-links issue.

Layout

assets/logo/       the lambda logo (SVG + rendered PNGs, OG images)
client/Main.hs     WASM/JS entry point (misoWithContext + hydration)
server/Main.hs     static site generator (HTML, sitemap, robots, RSS, manifest, motion.css, llms.txt)
server/Markdown.hs docs and blog Views rendered to Markdown for llms.txt
shared/Site.hs     root component: top bar, router dispatch, footer
shared/Site/       pages, docs content, demos, i18n, search, styles
static/            style.css, index.js (WASM loader)
scripts/           check-demos.ts

Building

Everything runs through the flake (only nix required):

make          # build WASM + prerender all pages into public/
make serve    # http-server public/  โ†’  http://localhost:8080
make watch    # hot reload via the WASM browser GHCi
make js       # GHC JavaScript backend instead of WASM

To develop against a sibling ../miso checkout instead of the pinned release, pass PROJECT=cabal.project.dev:

make PROJECT=cabal.project.dev build prerender

Serving

public/ is a plain static site. Every route is a real directory with an index.html, so any static file server works:

http-server public   # or: netlify / cloudflare pages / nginx / s3 โ€ฆ

Configure your host to serve 404.html for unknown paths.

About

๐Ÿœ The official haskell-miso.org website

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages