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-08-20 21:54:10 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-06 18:32:21 +0300
commit35d2eac490399aeba01478192f4bacdcf62c618a (patch)
tree31aa6ebd66047aa581e4fbf9013fca1b49771a5f /hugolib
parent09ed41be71de582d829554e145bf9d2d59f34aae (diff)
Fix go vet 1.7 issues
Updates #2309
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/hugo_sites_test.go26
-rw-r--r--hugolib/node.go1
-rw-r--r--hugolib/site.go8
3 files changed, 16 insertions, 19 deletions
diff --git a/hugolib/hugo_sites_test.go b/hugolib/hugo_sites_test.go
index b19e9ea2e..4a6001339 100644
--- a/hugolib/hugo_sites_test.go
+++ b/hugolib/hugo_sites_test.go
@@ -790,7 +790,7 @@ func createMultiTestSitesForConfig(t *testing.T, configContent, configSuffix str
// Sources
sources := []source.ByteSource{
- {filepath.FromSlash("sect/doc1.en.md"), []byte(`---
+ {Name: filepath.FromSlash("sect/doc1.en.md"), Content: []byte(`---
title: doc1
slug: doc1-slug
tags:
@@ -804,7 +804,7 @@ publishdate: "2000-01-01"
NOTE: slug should be used as URL
`)},
- {filepath.FromSlash("sect/doc1.fr.md"), []byte(`---
+ {Name: filepath.FromSlash("sect/doc1.fr.md"), Content: []byte(`---
title: doc1
plaques:
- frtag1
@@ -819,7 +819,7 @@ publishdate: "2000-01-04"
NOTE: should be in the 'en' Page's 'Translations' field.
NOTE: date is after "doc3"
`)},
- {filepath.FromSlash("sect/doc2.en.md"), []byte(`---
+ {Name: filepath.FromSlash("sect/doc2.en.md"), Content: []byte(`---
title: doc2
publishdate: "2000-01-02"
---
@@ -827,7 +827,7 @@ publishdate: "2000-01-02"
*some content*
NOTE: without slug, "doc2" should be used, without ".en" as URL
`)},
- {filepath.FromSlash("sect/doc3.en.md"), []byte(`---
+ {Name: filepath.FromSlash("sect/doc3.en.md"), Content: []byte(`---
title: doc3
publishdate: "2000-01-03"
tags:
@@ -839,7 +839,7 @@ url: /superbob
*some content*
NOTE: third 'en' doc, should trigger pagination on home page.
`)},
- {filepath.FromSlash("sect/doc4.md"), []byte(`---
+ {Name: filepath.FromSlash("sect/doc4.md"), Content: []byte(`---
title: doc4
plaques:
- frtag1
@@ -850,7 +850,7 @@ publishdate: "2000-01-05"
NOTE: should use the DefaultContentLanguage and mark this doc as 'fr'.
NOTE: doesn't have any corresponding translation in 'en'
`)},
- {filepath.FromSlash("other/doc5.fr.md"), []byte(`---
+ {Name: filepath.FromSlash("other/doc5.fr.md"), Content: []byte(`---
title: doc5
publishdate: "2000-01-06"
---
@@ -859,40 +859,40 @@ publishdate: "2000-01-06"
NOTE: should use the "permalinks" configuration with :filename
`)},
// Add some for the stats
- {filepath.FromSlash("stats/expired.fr.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/expired.fr.md"), Content: []byte(`---
title: expired
publishdate: "2000-01-06"
expiryDate: "2001-01-06"
---
# Expired
`)},
- {filepath.FromSlash("stats/future.fr.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/future.fr.md"), Content: []byte(`---
title: future
publishdate: "2100-01-06"
---
# Future
`)},
- {filepath.FromSlash("stats/expired.en.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/expired.en.md"), Content: []byte(`---
title: expired
publishdate: "2000-01-06"
expiryDate: "2001-01-06"
---
# Expired
`)},
- {filepath.FromSlash("stats/future.en.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/future.en.md"), Content: []byte(`---
title: future
publishdate: "2100-01-06"
---
# Future
`)},
- {filepath.FromSlash("stats/draft.en.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/draft.en.md"), Content: []byte(`---
title: expired
publishdate: "2000-01-06"
draft: true
---
# Draft
`)},
- {filepath.FromSlash("stats/tax.nn.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/tax.nn.md"), Content: []byte(`---
title: Tax NN
publishdate: "2000-01-06"
weight: 1001
@@ -901,7 +901,7 @@ lag:
---
# Tax NN
`)},
- {filepath.FromSlash("stats/tax.nb.md"), []byte(`---
+ {Name: filepath.FromSlash("stats/tax.nb.md"), Content: []byte(`---
title: Tax NB
publishdate: "2000-01-06"
weight: 1002
diff --git a/hugolib/node.go b/hugolib/node.go
index fed759eeb..3b3d40394 100644
--- a/hugolib/node.go
+++ b/hugolib/node.go
@@ -17,7 +17,6 @@ import (
"html/template"
"path"
"path/filepath"
- //"sort"
"strings"
"sync"
"time"
diff --git a/hugolib/site.go b/hugolib/site.go
index 50bca2ea2..32e19a8b1 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1724,11 +1724,10 @@ func taxonomyRenderer(prepare bool, s *Site, taxes <-chan taxRenderInfo, results
if !viper.GetBool("DisableRSS") {
// XML Feed
- c := *n
- rssNode := &c
- rssNode.nodeID = ""
+ rssNode := s.newNode(fmt.Sprintf("%s-%s-rss", t.plural, t.key))
rssuri := viper.GetString("RSSUri")
s.setURLs(rssNode, base+"/"+rssuri)
+ rssNode.Data = n.Data
rssLayouts := []string{"taxonomy/" + t.singular + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
@@ -1858,8 +1857,7 @@ func (s *Site) renderSectionLists(prepare bool) error {
if !viper.GetBool("DisableRSS") && section != "" {
// XML Feed
rssuri := viper.GetString("RSSUri")
- c := *n
- rssNode := &c
+ rssNode := s.newSectionListNode(true, sectionName+"-rss", section, data, 0)
s.setURLs(rssNode, section+"/"+rssuri)
rssLayouts := []string{"section/" + section + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
if err := s.renderAndWriteXML("section "+section+" rss", rssNode.addLangPathPrefix(section+"/"+rssuri), rssNode, s.appendThemeTemplates(rssLayouts)...); err != nil {