StaticBlog.Web.PreviewRouter (StaticBlog v0.2.0)

Copy Markdown View Source

A minimal Plug router that serves the built _site/ directory as a static-file preview. Handles trailing-slash to index.html rewriting so clean URLs work the same as they will on Cloudflare R2.

The site root is resolved at runtime from the consumer's working directory, not at compile time, so the path is correct regardless of where the static_blog dependency is compiled.

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.