Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Asset Handling

typub provides flexible strategies for handling images and other assets in your content.

Audience

  • This page is platform-agnostic and user-facing.
  • For provider-level details and examples, see External Storage.

Basic Usage

Choose an asset strategy

StrategyHow it worksTypical usage
embedBase64 encode inlineSmall images, no upload dependency
uploadUpload to platform storagePlatforms with native media APIs
copyCopy to local outputLocal/static outputs
externalUpload to S3-compatible hostCDN, large assets, or platforms rejecting base64

Configuration

Per-platform Strategy

[platforms.devto]
enabled = true
asset_strategy = "embed"

[platforms.notion]
enabled = true
asset_strategy = "upload"

[platforms.astro]
enabled = true
asset_strategy = "copy"

Basic image reference

#image("./images/diagram.png", width: 80%)

typub resolves and rewrites image references based on the configured strategy.

Advanced Usage

External storage

Configure [storage] when using external:

[storage]
endpoint = "https://s3.amazonaws.com"
bucket = "my-content-bucket"
region = "us-east-1"
url_prefix = "https://cdn.example.com"

Credentials should come from environment variables.

Strategy selection guidance

  • Prefer upload when the platform supports native media upload.
  • Use external for large assets or CDN portability.
  • Use embed for simplicity when content size remains acceptable.
  • Use copy for local/static outputs.

Tracking

typub tracks uploaded assets to avoid duplicate uploads:

# See asset status
typub status --assets posts/my-post

Asset mappings are stored in .typub/status.db.