Avatar Ilya Mateyko

go.astrophena.name/site Module

GitHub repository | Commit (1c8c83e)

Personal site and a Go package that builds it.

package vanity

import "go.astrophena.name/site/vanity"

Package vanity provides functionality for building a static site that lists Go packages from GitHub repositories. The package handles fetching repository data, generating documentation, and building the site using templates.

Index

Functions

func Build

func Build(ctx context.Context, c *Config) error

Build constructs the static site by fetching repository data from GitHub, generating documentation, and building the site using templates.

Types

type Config

type Config struct {
	// Dir is a directory where the generated site will be stored.
	Dir string
	// GitHubToken is a token for accessing the GitHub API.
	GitHubToken string
	// ImportRoot is a root import path for the Go packages.
	ImportRoot string
	// Logf is a logger to use. If nil, log.Printf is used.
	Logf logger.Logf
	// HTTPClient is a HTTP client for making requests.
	HTTPClient *http.Client
}

Config holds the configuration for building the static site.