Documentation
¶
Overview ¶
Package scaffold renders the embedded template tree into a new site CLI repository. Every file under templates/ is a Go text/template using the delimiters << and >> (chosen so GitHub Actions ${{ ... }} and GoReleaser {{ ... }} expressions in the templates pass through untouched), and its path carries two replaceable tokens: BINARY for the command name and LIBPKG for the library package name.
Index ¶
Constants ¶
const ThemeSubmodule = "https://github.com/tamnd/tago-doks"
ThemeSubmodule is the docs theme every site shares, added as a git submodule at docs/themes/tago-doks so the docs workflow can build the tago site.
Variables ¶
This section is empty.
Functions ¶
func CreateRemote ¶
CreateRemote creates the GitHub repository with gh and pushes the current branch, wiring origin in the process.
func InitGit ¶
InitGit turns destDir into a git repo on main, adds the docs theme submodule, and makes the first commit. The submodule and commit are best-effort so a machine without network still gets a valid local repo.
Types ¶
type Options ¶
type Options struct {
Owner string
Binary string
Host string
Short string
Description string
License string
Author string
Email string
Year int
}
Options carries the parts of a Site a caller may override; zero values fall back to the house defaults in NewSite.
type Site ¶
type Site struct {
Name string // bare site name, e.g. "reddit"
Repo string // repository name, e.g. "reddit-cli"
Binary string // command/binary name, e.g. "reddit"
LibPkg string // library package name, e.g. "reddit"
Scheme string // resource-URI scheme the kit domain owns, e.g. "reddit"
Host string // the site host the client and domain target, e.g. "reddit.com"
EnvPrefix string // env var prefix, the upper-cased binary, e.g. "REDDIT"
Owner string // GitHub owner, e.g. "tamnd"
Module string // Go module path, e.g. "github.com/tamnd/reddit-cli"
Image string // container image, e.g. "ghcr.io/tamnd/reddit"
Domain string // docs domain, e.g. "reddit-cli.tamnd.com"
PagesURL string // GitHub Pages URL, e.g. "https://tamnd.github.io/reddit-cli/"
GitHubURL string // repo URL, e.g. "https://github.com/tamnd/reddit-cli"
Short string // one-line description
Description string // longer description
License string // SPDX id, e.g. "Apache-2.0"
Author string // copyright holder
Email string // maintainer email
Year int // copyright year
}
Site is the data a single template render is given.