code: func WithTemplates(b *Bundle) router.Middleware {
  	return func(c *router.Context, next router.Handler) {
  		// Note: Use(...) calls EnsureLoaded and initializes b.err inside.
  		c.Context = Use(c.Context, b, &Extra{
  			Request: c.Request,
  			Params:  c.Params,
  		})
  		if b.err != nil {
  			http.Error(c.Writer, fmt.Sprintf("Can't load HTML templates.\n%s", b.err), http.StatusInternalServerError)
  			return
  		}
  		next(c)
  	}
  }
docs: // WithTemplates is middleware that lazily loads template bundle and injects it
  // into the context.
  //
  // Wrapper reply with HTTP 500 if templates can not be loaded. Inner handler
  // receives context with all templates successfully loaded.