smalldocs.publish

smalldocs publish gh-pages: put the built site on a branch and push it, without touching your working tree.

git

source

git(cwd: Path, *args: str, check: bool = True) -> CompletedProcess

Run git.

Parameter Type Default Description
cwd Path required Where to run git
args str required Its arguments
check bool True Raise when git fails
returns CompletedProcess What git did

publish

source

publish(root: Path, branch: str = 'gh-pages', remote: str = 'origin', render: bool = True, message: str = 'Built site') -> int

Build the site, commit the output folder to branch in a temporary worktree, and push it.

Parameter Type Default Description
root Path required The project folder
branch str 'gh-pages' The branch to publish to
remote str 'origin' The remote to push to
render bool True Build the site first
message str 'Built site' The commit message
returns int The exit code