github.com/bketelsen/buffalo@v0.9.5/generators/assets/standard/standard.go (about)

     1  package standard
     2  
     3  import (
     4  	"path/filepath"
     5  
     6  	"github.com/gobuffalo/buffalo/generators"
     7  	"github.com/gobuffalo/buffalo/generators/assets"
     8  	"github.com/gobuffalo/makr"
     9  )
    10  
    11  var logo = &makr.RemoteFile{
    12  	File:       makr.NewFile("public/assets/images/logo.svg", ""),
    13  	RemotePath: assets.LogoURL,
    14  }
    15  
    16  // New standard assets generator for those wishing to not use webpack
    17  func New(data makr.Data) (*makr.Generator, error) {
    18  	files, err := generators.Find(filepath.Join(generators.TemplatesPath, "assets", "standard"))
    19  	if err != nil {
    20  		return nil, err
    21  	}
    22  	g := makr.New()
    23  	for _, f := range files {
    24  		g.Add(makr.NewFile(f.WritePath, f.Body))
    25  	}
    26  	g.Add(logo)
    27  	return g, nil
    28  }