pyssg is pre-1.0 and under active development - APIs, config, and themes may change.
pyssg.plugins.asset_copy

1 min read

pyssg.plugins.asset_copy

Asset-copy plugin.

Copies the active layout's assets/ directory into the build output under /assets/..., preserving the directory structure. A file is (re)written only when it is missing from the output or its bytes differ from the source, so rebuilds stay cheap and the output is byte-identical to a full rebuild.

The copy is keyed on evaluate_collections because that hook fires once per finalize and the layout's assets_dir is the only input -- the copy is a deterministic function of the source bytes (no clock, no globals). It never deletes files it did not place, so user/output files are left untouched.

copy_assets(build: Build) -> None

Mirror the layout assets/ tree into the output assets/ tree.

class AssetCopyPlugin

Built-in copier for the layout's static assets.

AssetCopyPlugin.apply(self, builder: Builder) -> None

asset_copy() -> AssetCopyPlugin

Factory used in pyssg.config.py.