package templates

import "golang.org/x/pkgsite/internal/frontend/templates"

Index

Functions

func ParsePageTemplates

func ParsePageTemplates(fsys template.TrustedFS) (map[string]*template.Template, error)

ParsePageTemplates parses html templates contained in the given filesystem in order to generate a map of Name->*template.Template.

Separate templates are used so that certain contextual functions (e.g. templateName) can be bound independently for each page.

Templates in directories prefixed with an underscore are considered helper templates and parsed together with the files in each base directory.

Source Files

templates.go

Version
v0.0.0-20250218150137-224a1368cf02 (latest)
Published
Feb 18, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
2 months ago

Tools for package owners.