//pipressbypi0

pipress

πŸ—Ώ Turn any URL with Markdown, HTML and Assets into a website!

34
0
34
Shell

πŸ—Ώ pipress

Tiny server hosting pi0.io (or anything else!)

πŸ’‘ How it works?

Idea is simple, Turn any base url with raw Markdown, HTML and Assets into a website!

Website contents can be hosted anywhere, such as from https://raw.githubusercontent.com/pi0/pi0.io/refs/heads/main (pi0/pi0.io).

When opening a URL like /about, the server fetches {BASE_URL}/about.md and renders Markdown to HTML using md4w.

The web server then uses {BASE_URL}/index.html as an HTML template, replacing the {{ content }} placeholder with the rendered markdown content.

Any other URL ending with an extension, will be directly fetched and served as static asset with proper mime type.

All remote content are cached with simple SWR strategy (stale 1 second).

Check the source code.

βœ… Local preview

Local dir:

npx pipress .

Or remote URL:

npx pipress https://raw.githubusercontent.com/pi0/pi0.io/refs/heads/main

πŸ‘‰πŸ» Self-hosted using docker

undefineddocker-compose.yaml:undefined

services:
  www:
    image: ghcr.io/pi0/pipress
    restart: unless-stopped
    environment:
      PIPRESS_URL: "https://raw.githubusercontent.com/pi0/pi0.io/refs/heads/main"
    ports:
      - 3140:3000

[!TIP]
Use watchtower for auto updates.

βš™οΈ Env variables

  • PIPRESS_URL
  • PIPRESS_TTL (default 1000)
  • PIPRESS_STATIC_TTL (default 1000)

🧩 Stack

  • undefinedServer: srvx
  • undefinedMarkdown Renderer: ije/md4w
  • undefinedCode highlighter: shikijs
[beta]v0.13.0