assets

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package assets owns the Githome web front's built static assets: the content-hashed CSS and JS bundles, the manifest that maps a logical name to its hashed file, and the Octicon icon registry the render layer inlines. The bundles are produced by the build command in ./build and embedded here; nothing in this package imports the web front or the persistence layer. See implementation/01 and implementation/04.

Index

Constants

This section is empty.

Variables

View Source
var Icons = map[string]Icon{}/* 376 elements not displayed */

Icons is the 16-grid set: the natural size for inline UI chrome. The render layer's octicon helper wraps a lookup in the outer <svg> with the size and accessibility attributes; an unknown name renders a visible placeholder, never the input, so a typo is caught in review rather than shipped (see implementation/04 section 8 and implementation/03 section 4).

View Source
var Icons24 = map[string]Icon{}/* 346 elements not displayed */

Icons24 is the 24-grid set. The octicon helper prefers it when an icon renders at 24px or larger (the header logo, blankslate heroes), so big renders get the heavier 24-grid drawing instead of an upscaled 16-grid one (spec 2005 doc 16 section 8.2). Icons that only exist on the 16 grid fall back to it at any size.

Functions

func Dev

func Dev() bool

Dev reports whether assets are read from disk (the fedev build). In the production build it is always false, so the render layer caches the manifest once and serves immutable, far-future-cached asset responses.

func FS

func FS() fs.FS

FS returns the built asset tree rooted at dist, so a path like "app.<hash>.css" resolves directly. In the production build the tree is the embedded one; the fedev build reads from disk instead.

Types

type Icon added in v0.1.3

type Icon struct {
	Width  int
	Height int
	Body   string
}

Icon is one registered glyph: the grid its viewBox was drawn on and the inner SVG markup. Width equals Height for every icon except the handful of wordmark glyphs (logo-github, lockup-github), so the render helper derives the viewBox and the scaled pixel width from these instead of assuming a square 16-grid.

Directories

Path Synopsis
Command build regenerates the embedded web-front bundle in fe/assets/dist.
Command build regenerates the embedded web-front bundle in fe/assets/dist.

Jump to

Keyboard shortcuts

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