Files
kage/docs/content/guides/serving-a-mirror.md
T
Duc-Tam Nguyen 3af26ae0e5 Rewrite the README and add a recorded demo
Rework the README into the house style: badges, a one-line pitch, an
anchor nav, a commands table, and dedicated sections for clone, pack, and
the native viewer. Every flag and default is checked against the current
binary so the docs match what kage actually does.

Add a demo recorded with ascii-gif. The tape clones example.com, packs it
to a ZIM and to a self-contained binary, and serves it back offline, so
the whole loop reads in one frame. It sits at the top of the README and on
the docs home.

While reviewing the docs, fix the output path everywhere: the default is
$HOME/data/kage, not the kage-out the pages claimed, including a few
fabricated 'done kage-out/...' lines. Document pack, open, and the native
viewer in the release notes.
2026-06-14 22:25:31 +07:00

1.3 KiB

title, description, weight
title description weight
Serving a mirror View a cloned folder the way it would render on a real host, with kage serve. 20

A clone is a plain folder of files, so the simplest way to view it is to open an .html file in your browser. That works for many sites. But some pages use root-relative URLs (/style.css, /img/logo.png), which only resolve correctly when served from the root of a host. kage serve gives you that root.

Serve a clone

kage serve $HOME/data/kage/example.com
kage serve $HOME/data/kage/example.com
  open http://127.0.0.1:8800
  press Ctrl-C to stop

Open the printed URL and click around the mirror exactly as you would the live site. Every in-scope link kage rewrote points at another saved page; every asset resolves to its localised copy.

Choose an address

By default kage serves on 127.0.0.1:8800. Change it with --addr:

# A different port
kage serve $HOME/data/kage/example.com --addr 127.0.0.1:9000

# Reachable from other machines on your network (be deliberate about this)
kage serve $HOME/data/kage/example.com --addr 0.0.0.0:8800

Serve the current directory

With no argument, kage serve serves the current directory, which is handy from inside an output folder:

cd $HOME/data/kage/example.com
kage serve