partials

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package partials hosts the repository-template-specific partials the M7 layout needs. They are NOT registered in the global classic partials registry — instead the parent repository package consumes them through the per-template lookup table in repository.go.

All four functions follow the M2 partial contract (nil-safe, XML-escaped, single-line SVG fragment string).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseActivity

func BaseActivity(_ context.Context, pc *templates.PartialContext) (string, error)

BaseActivity renders the recent commits / open issues / open PRs triple. Returns "" when data.Repo is nil OR the repo is archived AND has no activity to show.

func BaseCommunity

func BaseCommunity(_ context.Context, pc *templates.PartialContext) (string, error)

BaseCommunity renders contributors / stargazers / forks counts. Returns "" when data.Repo is nil OR all counts are zero (so empty repos do not render a stray empty section).

func BaseHeader

func BaseHeader(_ context.Context, pc *templates.PartialContext) (string, error)

BaseHeader renders the upstream `base.header.ejs`-equivalent repo chrome: the repository name plus the two-column stats row (Created / Deployed / disk-usage on the left, the contribution mini-calendar / Environments on the right). Returns "" when data.Repo is nil so the dispatch path stays nil-safe. #464.

func Introduction

func Introduction(_ context.Context, pc *templates.PartialContext) (string, error)

Introduction surfaces the repo's about text + primary language / license badges. Returns "" when data.Repo is nil.

func Lookup

func Lookup(name string) (templates.PartialFunc, bool)

Lookup returns the repository-template partial for the given name, or nil when none is owned by this package. Plugin partial names (`languages`, `activity`, etc.) are intentionally absent — the repository template's Run resolves those through the shared classic partials registry where the per-plugin packages already register them by name.

func SetNow added in v1.1.0

func SetNow(now func() time.Time) func()

SetNow overrides the BaseHeader clock for tests and returns a restore function. Not safe for concurrent use across parallel tests sharing the clock.

Types

This section is empty.

Jump to

Keyboard shortcuts

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