Skip to content

paul-norman/go-template-manager-fiber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

templateManager Fiber Integration

This is the package for the templateManager View engine integration for the Fiber framework.

For all options, please see the main repository.

Basic Usage

package main

import (
	"log"
	
	"github.com/gofiber/fiber/v2"
	TM "github.com/paul-norman/go-template-manager-fiber"
)

func main() {
	engine := TM.Init("./views", ".html")
	engine.ExcludeDirectories([]string{"layouts", "partials"}).
			Reload(true).
			Debug(true)

	app := fiber.New(fiber.Config{
		Views: engine,
	})

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

	log.Fatal(app.Listen(":8080"))
}

About

TemplateManager View Engine Integration for the Fiber framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages