templates

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

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