Skip to content

template

gh docs template copies embedded site templates into an output folder. The current template type is Jekyll, intended for GitHub Pages to build without a separate local Jekyll build step.

Terminal window
gh docs template --jekyll --output docz

By default, the output folder is docs. Use another folder when that name conflicts with the extension binary or an existing file.

FlagDefaultDescription
--jekyllNot enabledRequired. Selects the Jekyll template.
-c, --config.docs.ymlPath to the configuration file.
-o, --outputdocsDestination folder.
--forceNot enabledOverwrite generated files if they already exist.

The template node in .docs.yml supports the output setting. The --output flag takes precedence over that setting.

The command copies the embedded files index.md and _config.yml. The index reads docs-repos.yml from the site root and renders each entry as a link when it has a homepage URL.

If either generated file already exists, the command stops before writing unless --force is supplied. Use --force only when replacing those files is intended.

Terminal window
gh docs template --jekyll --output docz --force