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
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-03 13:36:47 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-22 11:57:03 +0300
commitc175407fa40593f34e5b5b25c8f5c921bec2a636 (patch)
tree5528628b677844e67abf0b51984b757cd216ebc1 /hugolib
parent3ff25b37a3d327646255572072d6686d48a142e9 (diff)
node to page: Use _index as identificator for the list nodes
Updates #2297
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/node.go4
-rw-r--r--hugolib/node_as_page_test.go12
2 files changed, 8 insertions, 8 deletions
diff --git a/hugolib/node.go b/hugolib/node.go
index f01b4c822..133763c81 100644
--- a/hugolib/node.go
+++ b/hugolib/node.go
@@ -372,11 +372,11 @@ func sectionsFromFilename(filename string) []string {
// TODO(bep) np node identificator
func nodeTypeFromFilename(filename string) NodeType {
- if !strings.Contains(filename, "_node") {
+ if !strings.Contains(filename, "_index") {
return NodePage
}
- if strings.HasPrefix(filename, "_node") {
+ if strings.HasPrefix(filename, "_index") {
return NodeHome
}
diff --git a/hugolib/node_as_page_test.go b/hugolib/node_as_page_test.go
index 8276f2d23..30f7fd80f 100644
--- a/hugolib/node_as_page_test.go
+++ b/hugolib/node_as_page_test.go
@@ -51,37 +51,37 @@ func TestNodesAsPage(t *testing.T) {
writeLayoutsForNodeAsPageTests(t)
- writeSource(t, filepath.Join("content", "_node.md"), `---
+ writeSource(t, filepath.Join("content", "_index.md"), `---
title: Home Sweet Home!
---
Home **Content!**
`)
- writeSource(t, filepath.Join("content", "sect1", "_node.md"), `---
+ writeSource(t, filepath.Join("content", "sect1", "_index.md"), `---
title: Section1
---
Section1 **Content!**
`)
- writeSource(t, filepath.Join("content", "sect2", "_node.md"), `---
+ writeSource(t, filepath.Join("content", "sect2", "_index.md"), `---
title: Section2
---
Section2 **Content!**
`)
- writeSource(t, filepath.Join("content", "categories", "hugo", "_node.md"), `---
+ writeSource(t, filepath.Join("content", "categories", "hugo", "_index.md"), `---
title: Taxonomy Hugo
---
Taxonomy Hugo **Content!**
`)
- writeSource(t, filepath.Join("content", "categories", "web", "_node.md"), `---
+ writeSource(t, filepath.Join("content", "categories", "web", "_index.md"), `---
title: Taxonomy Web
---
Taxonomy Web **Content!**
`)
- writeSource(t, filepath.Join("content", "categories", "_node.md"), `---
+ writeSource(t, filepath.Join("content", "categories", "_index.md"), `---
title: Taxonomy Term Categories
---
Taxonomy Term Categories **Content!**