Skip to content
/ pipress Public

🗿 Turn any URL with Markdown, HTML and Assets into a website!

Notifications You must be signed in to change notification settings

pi0/pipress

Repository files navigation

🗿 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

docker-compose.yaml:

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

About

🗿 Turn any URL with Markdown, HTML and Assets into a website!

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages