arnaucube
arnaucube/konstruiPublic Self-hosted repository
prints cleaned
arnaucode arnaucode@gmail.com
Wed, 11 Oct 2017 00:19:33 +0200
commit

5a9ebd9c4d039016e35c9233ce29c32dd17ac97b

parent

94b03c541bfe9b65230d6936d017a1d4ce9aaff8

3 files changed, 5 insertions(+), 6 deletions(-)

jump to
M fileOperations.go → fileOperations.go

@@ -76,7 +76,7 @@ err := ioutil.WriteFile(path, []byte(newContent), 0644)

check(err) color.Green(path + ":") - color.Blue(newContent) + //color.Blue(newContent) } /*func generatePageFromTemplateAndData(templateContent string, entry dataEntry) string {
M templating.go → templating.go

@@ -1,8 +1,6 @@

package main import ( - "fmt" - "strconv" "strings" "github.com/Jeffail/gabs"

@@ -15,7 +13,8 @@ result = result + original

} return result } -func replaceEntryOLD(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string { + +/*func replaceEntryOLD(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string { //replace {{}} with data var keys []string for key, _ := range entry {

@@ -36,7 +35,7 @@ }

} return templateContent -} +}*/ func replaceEntry(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string { //fmt.Println(jsonData) children, _ := jsonData.S().ChildrenMap()

@@ -106,7 +105,7 @@ f := concatStringsWithJumps(fragmentLines)

children, _ := jsonData.S(elemName).Children() var replaced string for _, child := range children { - fmt.Println(child.Data().(string)) + //fmt.Println(child.Data().(string)) replacedElem := strings.Replace(f, "{{"+elemName+"}}", child.Data().(string), -1) replaced = replaced + replacedElem }