GithubHelp home page GithubHelp logo

h3poteto / pongo2echo Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 44 KB

Package pongo2echo provides renderer for labstack's echo framework

License: MIT License

Go 97.42% HTML 2.58%
golang echo pongo2

pongo2echo's Introduction

Pongo2Echo

Build GoDoc GitHub release (latest by date) Dependabot

pongo2echo provides pongo2 renderer for echo which is web application framework written by golang. Pongo2 is a template engine likes django-syntax for golang.

This package is useful when you use pongo2 template in echo.

Usage

Setup pongo2echo render when initialize echo.

import (
	"github.com/h3poteto/pongo2echo"
	"github.com/labstack/echo"
)

func main() {
	render := pongo2echo.NewRenderer()
	render.AddDirectory("server/templates")
	e := echo.New()
	e.Renderer = render

	e.GET("/", func(c echo.Context) error {
		// index.html.tpl is located in server/templates/index.html.tpl
		return c.Render(http.StatusOK, "index.html.tpl",  map[string]interface{}{"title": "Index"})
	})
	e.Logger.Fatal(e.Start(":1323"))
}

You can use pongo2 templte in Render function, and pass variables to template.

License

The package is available as open source under the terms of the MIT License.

pongo2echo's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar h3poteto avatar kimihito avatar mtmtcode avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mtmtcode kimihito

pongo2echo's Issues

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

go: gopkg.in/[email protected]: invalid version: git fetch -f https://gopkg.in/mgo.v2 refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /opt/go/gopath/pkg/mod/cache/vcs/7999e2beb88d49c16df3019dc281fbfef947b52d6454ecb8905b12aea326f558: exit status 128:
	fatal: The remote end hung up unexpectedly
	fatal: early EOF
	fatal: index-pack failed

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.