templates

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package templates provides tree-based template loading and rendering using HTML templates from the Go standard library.

Use Templates to obtain an acceptable.Processor loaded with the specified template files.

Index

Constants

View Source
const DefaultPage = "_index.html"

Variables

Fs is used to obtain file information and content. It can be stubbed for testing.

View Source
var ReloadOnTheFly = false

ReloadOnTheFly enables a development mode that reloads template files whenever they change, without restarting the server. This reduces performance and should be off (false) for production.

Functions

func Templates

func Templates(dir, suffix string, funcMap template.FuncMap) offer.Processor

Templates finds all the templates in the directory dir and its subdirectories that have names ending with the given suffix (usually ".html").

The function map can be nil if not required.

A processor is returned that handles requests using the templates available.

Types

This section is empty.

Jump to

Keyboard shortcuts

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