shithub: hugo

Download patch

ref: 301e4c7e78edabc4763cbf992624ad70ec4555b6
parent: 0406be3d547749b93dd4fd13e142982915b6ca1f
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Oct 26 16:50:12 EDT 2016

Make Amber read from the Afero source file system

--- a/tpl/template.go
+++ b/tpl/template.go
@@ -306,8 +306,14 @@
 	case ".amber":
 		templateName := strings.TrimSuffix(name, filepath.Ext(name)) + ".html"
 		compiler := amber.New()
-		// Parse the input file
-		if err := compiler.ParseFile(path); err != nil {
+		b, err := afero.ReadFile(hugofs.Source(), path)
+
+		if err != nil {
+			return err
+		}
+
+		// Parse the input data
+		if err := compiler.ParseData(b, path); err != nil {
 			return err
 		}