Documentation
¶
Index ¶
- func CacheControl(policy string, next http.Handler) http.Handler
- func EmbedFsFileHandler(fs embed.FS, file string, contentType string) http.Handler
- func StaticByteHandler(b []byte, contentType string) http.Handler
- func StaticPageHandler(ctx context.Context, c templ.Component) http.Handler
- type ClickableHeadingRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheControl ¶
CacheControl returns middleware that sets the Cache-Control header to the given policy.
func EmbedFsFileHandler ¶
EmbedFsFileHandler reads a file from an embedded filesystem and returns a handler that serves it with caching.
func StaticByteHandler ¶
StaticByteHandler returns a handler that serves static bytes with ETag-based cache validation.
Types ¶
type ClickableHeadingRenderer ¶
type ClickableHeadingRenderer struct {
// contains filtered or unexported fields
}
Wraps all headings in a anchor tag, so that they are clickable for navigation purposes.
Only headings that already have an ID attribute will be wrapped. parser.WithAutoHeadingID can be used to automatically add the ID attributes.
If multiple headings have the same ID, to avoid collision each subsequent ID will be suffixed with a sequence number.
func NewClickableHeadingRenderer ¶
func NewClickableHeadingRenderer() *ClickableHeadingRenderer
func (*ClickableHeadingRenderer) RegisterFuncs ¶
func (r *ClickableHeadingRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
Click to show internal directories.
Click to hide internal directories.