Skip to content

Commit

Permalink
pages in subdirectories are created correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Saunders committed Jul 27, 2017
1 parent fb90852 commit 90fb594
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
31 changes: 0 additions & 31 deletions src/cmd/gen/ace.go
Expand Up @@ -48,34 +48,3 @@ func aceOutputFilePath(from string) string {
toMake = strings.Replace(toMake, "ace", "html", 1)
return strings.Replace(toMake, "pages/", "", 1)
}

// func compileAce(filename string) error {
// var doc bytes.Buffer
// var siteName = filepathToSitename(filename)

// funcMap := template.FuncMap{
// "current_template": func() string { return filename },
// "copy": func(rel string) string { return helperCopyFile(rel, findSharedFile(siteName, rel), siteName) },
// }

// if tpl, err := ace.Load(aceInputFilePath(filename), "", &ace.Options{
// FuncMap: funcMap,
// DynamicReload: true,
// BaseDir: filepath.Join("sites", filepathToSitename(filename), "pages"),
// }); err == nil {

// if err := tpl.Execute(&doc, nil); err != nil {
// return err
// }

// writeStringToFile(aceOutputFilePath(filename), doc.String())

// } else {
// return err
// }
// return nil
// }

// func aceInputFilePath(from string) string {
// return trimExt(strings.Replace(from, filepath.Join("sites", filepathToSitename(from), "pages"), "", 1))
// }
4 changes: 4 additions & 0 deletions src/cmd/gen/build.go
Expand Up @@ -84,6 +84,10 @@ func (cfg *config) processDir(srcdir string, filetype string, processor Processo

if files, err := FileTypeGlob(srcdir, filetype); err == nil {
for _, name := range files {
// create directories if needed
dir, _ := filepath.Split(processor.dstfile(name))
makeDirIfMissing(dir)

tpl := NewTemplateWriter(name, processor.dstfile(name))
if tpl.err != nil {
return tpl.err
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/gen/filesystem.go
Expand Up @@ -185,8 +185,6 @@ func helperCopyFile(rel string, sitename string) string {
src := findFile(rel, sitename)
dest := filepath.Clean(filepath.Join("public", sitename, rel))

println("copying", src, dest)

dir, _ := filepath.Split(dest)
makeDirIfMissing(dir)

Expand Down

0 comments on commit 90fb594

Please sign in to comment.