Advanced Customization
This page groups advanced, platform-agnostic customization options for typub users.
Use this after you have completed the basic flow in Getting Started.
1. Configuration Resolution Layers
Many fields follow layered resolution. Highest priority wins:
meta.tomlplatform-specific (meta.platforms.<id>.*)meta.tomlpost-level defaults (field-dependent)typub.tomlplatform-specific (platforms.<id>.*)typub.tomlglobal defaults (field-dependent)- Adapter/default fallback
See RFC-0005 for normative rules.
2. Asset Strategy and Storage
Per-platform strategy
[platforms.devto]
asset_strategy = "external"
External storage
[storage]
endpoint = "https://s3.amazonaws.com"
bucket = "my-bucket"
region = "us-east-1"
url_prefix = "https://cdn.example.com"
Use environment variables for secrets.
See External Storage and RFC-0004.
3. Node Policy Override
You can override adapter default node policy per platform.
Supported actions:
passsanitizedroperror
In typub.toml
[platforms.wechat]
node_policy = { raw = "sanitize", unknown = "drop" }
In meta.toml (higher priority)
[platforms.wechat]
node_policy = { raw = "error" }
Partial override is allowed. Unset fields fall back to lower layers and then adapter defaults.
4. Copy-paste Profile Extension (Contributor-Level)
If you need new built-in copy-paste profile behavior:
- Edit
crates/adapters/typub-adapter-copypaste/profiles.toml - Adjust compat behavior in
crates/adapters/typub-adapter-copypaste/src/adapter.rswhen needed
This is a repository customization workflow, not a runtime per-project override.
5. Advanced Debugging
Use dry-run and stage dump to inspect behavior:
typub publish posts/my-post -p wechat -d -v
typub publish posts/my-post -p wechat -d -D transform
6. Typst Preamble Override
typub supports user-defined Typst preamble via preamble, resolved with the
same layered model as other fields:
meta.toml[platforms.<id>].preamblemeta.toml.preambletypub.toml[platforms.<id>].preambletypub.toml.preamble- adapter default preamble
When a user preamble is resolved, typub appends it after adapter preamble to preserve platform-specific defaults.
See Theme Customization.