Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2014-12-07 21:48:00 +0300
committerspf13 <steve.francia@gmail.com>2014-12-09 17:43:15 +0300
commit9f77f93071d836a35b0078d1b349968abddb4a18 (patch)
tree909238a41b20b9e23324e4ffca01e8143655dd4a /tpl
parent3a8c12418a97230df714488e522f44ce8af685c5 (diff)
Fix various Windows-issues
File handling was broken on Windows. This commit contains a revision of the path handling with separation of file paths and urls where needed. There may be remaining issues and there may be better ways to do this, but it is easier to start that refactoring job with a set of passing tests. Fixes #687 Fixes #660
Diffstat (limited to 'tpl')
-rw-r--r--tpl/template.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tpl/template.go b/tpl/template.go
index f61376552..5010af9ae 100644
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -603,6 +603,7 @@ func ExecuteTemplate(context interface{}, layouts ...string) *bytes.Buffer {
buffer := new(bytes.Buffer)
worked := false
for _, layout := range layouts {
+
name := layout
if localTemplates.Lookup(name) == nil {
@@ -701,7 +702,7 @@ func (t *GoHtmlTemplate) AddTemplateFile(name, path string) error {
}
-func (t *GoHtmlTemplate) generateTemplateNameFrom(base, path string) string {
+func (t *GoHtmlTemplate) GenerateTemplateNameFrom(base, path string) string {
return filepath.ToSlash(path[len(base)+1:])
}
@@ -720,7 +721,7 @@ func (t *GoHtmlTemplate) loadTemplates(absPath string, prefix string) {
return nil
}
- tplName := t.generateTemplateNameFrom(absPath, path)
+ tplName := t.GenerateTemplateNameFrom(absPath, path)
if prefix != "" {
tplName = strings.Trim(prefix, "/") + "/" + tplName