package module
v2.1.9 Latest Latest

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 12 Imported by: 5


id: jet title: Jet

Release Discord Test Security Linter

Jet is a template engine create by cloudykit, to see the original syntax documentation please click here

Basic Example


{{include "partials/header"}}

<h1>{{ Title }}</h1>

{{include "partials/footer"}}






<!DOCTYPE html>


  {{ embed() }}

package main

import (

func main() {
	// Create a new engine
	engine := jet.New("./views", ".jet")

	// Or from an embedded system
	// See for examples
	// engine := jet.NewFileSystem(http.Dir("./views", ".jet"))

	// Pass the engine to the views
	app := fiber.New(fiber.Config{
		Views: engine,

	app.Get("/", func(c *fiber.Ctx) error {
		// Render index
		return c.Render("index", fiber.Map{
			"Title": "Hello, World!",

	app.Get("/layout", func(c *fiber.Ctx) error {
		// Render index within layouts/main
		return c.Render("index", fiber.Map{
			"Title": "Hello, World!",
		}, "layouts/main")





This section is empty.


This section is empty.


This section is empty.


type Engine

type Engine struct {
	// templates
	Templates *jet.Set

Engine struct

func New

func New(directory, extension string) *Engine

New returns a Jet render engine for Fiber

func NewFileSystem

func NewFileSystem(fs http.FileSystem, extension string) *Engine

NewFileSystem returns a Jet render engine for Fiber with file system

func (*Engine) Load

func (e *Engine) Load() error

Load parses the templates to the engine.

func (*Engine) Render

func (e *Engine) Render(out io.Writer, name string, binding interface{}, layout ...string) error

Render will render the template by name

Jump to

Keyboard shortcuts

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