shithub: hugo

Download patch

ref: b716dbec1dadeb7fa6164eb10a3df427edd9d3de
parent: 55fcd2f30f4358a800932aa60160935c0c22f96d
author: Chase Adams <[email protected]>
date: Fri Nov 14 04:14:52 EST 2014

Fix template checking order in site.go

- Change order of HasPrefix to match correct order
- Remove theme concatenation to _internal in last loop of
  appendthemetemplates so it looks in the right place for internal
templates

Conflicts:
	hugolib/site.go

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -766,7 +766,7 @@
 		out := []string{}
 		// First place all non internal templates
 		for _, t := range in {
-			if !strings.HasPrefix("_internal/", t) {
+			if !strings.HasPrefix(t, "_internal/") {
 				out = append(out, t)
 			}
 		}
@@ -773,14 +773,15 @@
 
 		// Then place theme templates with the same names
 		for _, t := range in {
-			if !strings.HasPrefix("_internal/", t) {
+			if !strings.HasPrefix(t, "_internal/") {
 				out = append(out, "theme/"+t)
 			}
 		}
+
 		// Lastly place internal templates
 		for _, t := range in {
-			if strings.HasPrefix("_internal/", t) {
-				out = append(out, "theme/"+t)
+			if strings.HasPrefix(t, "_internal/") {
+				out = append(out, t)
 			}
 		}
 		return out
@@ -936,6 +937,7 @@
 
 		if !viper.GetBool("DisableRSS") {
 			// XML Feed
+			fmt.Println("Section...")
 			rssLayouts := []string{"section/" + section + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
 			s.setUrls(n, section+".xml")
 			b, err = s.renderXML("section "+section+" rss", n, s.appendThemeTemplates(rssLayouts)...)