Documentation
¶
Overview ¶
Package people owns the M4 "people" plugin. User mode fetches followers / following lists via GraphQL. Repository mode fetches contributors / stargazers / watchers through REST repository endpoints so the repository template can reuse the same people partial with real avatar data.
Index ¶
Constants ¶
const Name = "people"
Name is the canonical plugin slug.
Variables ¶
var Plugin plugins.Plugin = &peoplePlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
func Partial ¶
Partial renders the classic SVG fragment for the people plugin. Mirrors upstream org_repo/source/templates/classic/partials/people.ejs.
Output structure (per-type):
<section data-section="people">
[for each type with non-empty list]:
<section>
<h2 class="field"><svg octicon/>${label}</h2>
<div class="row">
<section class="people">
<img class="avatar" src="..." width="${size}" height="${size}" alt="" />
...
</section>
</div>
</section>
</section>
The wrapping `<section data-section="people">` is our addition for downstream CSS/JS selectors; the inner per-type `<section>` blocks preserve upstream's flat structure.
Types ¶
type Person ¶
type Person struct {
Login string `json:"login"`
Name string `json:"name"`
AvatarURL string `json:"avatarUrl"`
}
Person mirrors one entry from the upstream people list.
type Result ¶
type Result struct {
Skipped bool `json:"skipped,omitempty"`
SkippedReason string `json:"-"`
Mode string `json:"mode,omitempty"`
Size int `json:"size,omitempty"`
Types map[string][]Person `json:"types"`
Counts map[string]int `json:"counts,omitempty"`
}
Result is the JSON payload published under data.Plugins["people"].
Counts carries the true total per type as reported by the API (GraphQL UserConnection.totalCount for user-mode followers/following). It is distinct from len(Types[t]), which is bounded by the fetched page (plugin_people_limit). The header label must read the total (#470), while the avatar list still renders the limited slice. Repo mode is REST-based with no totalCount concept, so its entries are omitted here and the partial falls back to len(list).