StaticBlog.Publisher (StaticBlog v0.2.0)

Copy Markdown View Source

Publishes the built static site to a Cloudflare R2 bucket.

Uses Req as the HTTP transport and :aws_signature to generate AWS Signature V4 Authorization headers. Credentials are read from environment variables at call time (configurable via :r2_env_vars).

Summary

Functions

Sync site_dir to the configured R2 bucket.

Functions

sync(site_dir \\ "_site")

@spec sync(Path.t()) :: {:ok, map()} | {:error, term()}

Sync site_dir to the configured R2 bucket.

Arguments

  • site_dir is the directory whose tree will be uploaded. Defaults to "_site".

Returns

  • {:ok, %{uploaded: n, skipped: n, deleted: n}} on success.

  • {:error, reason} if credentials are missing or a request fails.