templates

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitSignature added in v1.3.0

type CommitSignature struct {
	Config    *config.Config
	Signature *object.Signature
}

CommitSignature contains all the data needed to render signature identity (who).

func (CommitSignature) EmailDomain added in v1.3.0

func (c CommitSignature) EmailDomain() string

func (CommitSignature) EmailUsername added in v1.3.0

func (c CommitSignature) EmailUsername() string

type Error404Data

type Error404Data struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	// Diagnosis is debug text supposed to attach to a bug report for website owner.
	Diagnosis string
}

Error404Data is a data object passed to "404" template.

type Error500Data

type Error500Data struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	// Diagnosis is debug text supposed to attach to a bug report for website owner.
	Diagnosis string
}

Error500Data is a data object passed to "500" template.

type RepoBlobRefData

type RepoBlobRefData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	// Path to the blob.
	Path []string

	// Content of the blob.
	Content string

	SyntaxHighlightedContent template.HTML

	// LineNumbers holds sequential numbers starting from 1 up to line count of the blob.
	LineNumbers []uint

	// A list of preview output types.
	PreviewTypes []string
}

RepoBlobRefData is a data object passed to "repo-blob-ref" template.

type RepoBlobRefHTMLPreviewData

type RepoBlobRefHTMLPreviewData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	// Path to the blob.
	Path []string

	// Rendered HTML
	Content template.HTML
}

RepoBlobRefHTMLPreviewData is a data object passed to "repo-blob-ref-html-preview" template.

type RepoCommitData

type RepoCommitData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	Commit *object.Commit
	Parent *object.Commit

	Diff *git.NiceDiff
}

RepoCommitData is a data object passed to "repo-commit" template.

func (RepoCommitData) FileDiffStat

func (r RepoCommitData) FileDiffStat(file *gitdiff.File) string

func (RepoCommitData) IsLargeDiff

func (r RepoCommitData) IsLargeDiff(file *gitdiff.File) bool

type RepoListData

type RepoListData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	// Repositories is a slice of every repositories legit sees.
	Repositories []RepositorySummary
}

RepoListData is a data object passed to "repo-list" template.

func (RepoListData) RepositoriesByCategory

func (d RepoListData) RepositoriesByCategory() []RepositoriesByCategory

type RepoLogRefData

type RepoLogRefData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	// Commits made to the ref.
	Commits []*object.Commit

	PrevPageHref string
	NextPageHref string
}

RepoLogRefData is a data object passed to "repo-log-ref" template.

func (RepoLogRefData) BottomCommitForRange

func (r RepoLogRefData) BottomCommitForRange() *object.Commit

func (RepoLogRefData) TopCommitForRange

func (r RepoLogRefData) TopCommitForRange() *object.Commit

type RepoRefsData

type RepoRefsData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	// Tags is a list of git tags (annotate and lightweight) in the repository.
	Tags []*git.TagReference

	Branches []*plumbing.Reference
}

RepoRefsData is a data object passed to "repo-refs" template.

type RepoTopData

type RepoTopData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	// Rendered README.
	Readme template.HTML

	// DefaultBranch is textual representation of repository's default branch.
	DefaultBranch string

	// RecentCommits is a list of recent commits made in the default branch.
	RecentCommits []*object.Commit

	// Whether this repository is available as Go Module.
	IsGoModule bool
}

RepoTopData is a data object passed to "repo-top" template.

type RepoTreeRefData

type RepoTreeRefData struct {
	// Config represents a resolved config based on "config.yaml".
	Config *config.Config

	Meta RepositoryMeta

	// Path to the current directory. On repository root, this is empty slice.
	Path []string

	// Files is a list of files for the current directory.
	Files []git.NiceTree
}

RepoTreeRefData is a data object passed to "repo-tree-ref" template.

type RepositoriesByCategory

type RepositoriesByCategory struct {
	Category     string
	Repositories []RepositorySummary
}

type RepositoryMeta

type RepositoryMeta struct {
	// DisplayName is a directory name without ".git" suffix.
	DisplayName string

	// DirName is a directory name of the repository.
	DirName string

	// Description is a contents of "description" text file in the repository root.
	Description string

	// Ref is a ref for the current context. If a page is not tied to refs, default branch
	// will be set.
	Ref string
}

RepositoryMeta is a shared data object passed to every pages under each repositories.

func (RepositoryMeta) Signature added in v1.3.0

func (_ RepositoryMeta) Signature(config *config.Config, signature *object.Signature) CommitSignature

Signature returns template pipeline data for "commit-signature-" templates. This method is for RepositoryMeta, because every page data contains RepositoryMeta.

type RepositorySummary

type RepositorySummary struct {
	// DisplayName is a directory name without ".git" suffix.
	DisplayName string

	// DirName is a directory name of the repository.
	DirName string

	// Description is a contents of "description" text file in the repository root.
	Description string

	// Category is gitweb compatible repository category text. Unless "ui.category.grouping"
	// option is set, this field is always empty.
	Category string

	LastCommit *object.Commit
}

RepositorySummary contains overview of a git repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL