mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-19 03:52:37 +00:00
parent
09ed41be71
commit
35d2eac490
3 changed files with 16 additions and 19 deletions
|
@ -790,7 +790,7 @@ func createMultiTestSitesForConfig(t *testing.T, configContent, configSuffix str
|
||||||
|
|
||||||
// Sources
|
// Sources
|
||||||
sources := []source.ByteSource{
|
sources := []source.ByteSource{
|
||||||
{filepath.FromSlash("sect/doc1.en.md"), []byte(`---
|
{Name: filepath.FromSlash("sect/doc1.en.md"), Content: []byte(`---
|
||||||
title: doc1
|
title: doc1
|
||||||
slug: doc1-slug
|
slug: doc1-slug
|
||||||
tags:
|
tags:
|
||||||
|
@ -804,7 +804,7 @@ publishdate: "2000-01-01"
|
||||||
|
|
||||||
NOTE: slug should be used as URL
|
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
|
title: doc1
|
||||||
plaques:
|
plaques:
|
||||||
- frtag1
|
- frtag1
|
||||||
|
@ -819,7 +819,7 @@ publishdate: "2000-01-04"
|
||||||
NOTE: should be in the 'en' Page's 'Translations' field.
|
NOTE: should be in the 'en' Page's 'Translations' field.
|
||||||
NOTE: date is after "doc3"
|
NOTE: date is after "doc3"
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("sect/doc2.en.md"), []byte(`---
|
{Name: filepath.FromSlash("sect/doc2.en.md"), Content: []byte(`---
|
||||||
title: doc2
|
title: doc2
|
||||||
publishdate: "2000-01-02"
|
publishdate: "2000-01-02"
|
||||||
---
|
---
|
||||||
|
@ -827,7 +827,7 @@ publishdate: "2000-01-02"
|
||||||
*some content*
|
*some content*
|
||||||
NOTE: without slug, "doc2" should be used, without ".en" as URL
|
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
|
title: doc3
|
||||||
publishdate: "2000-01-03"
|
publishdate: "2000-01-03"
|
||||||
tags:
|
tags:
|
||||||
|
@ -839,7 +839,7 @@ url: /superbob
|
||||||
*some content*
|
*some content*
|
||||||
NOTE: third 'en' doc, should trigger pagination on home page.
|
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
|
title: doc4
|
||||||
plaques:
|
plaques:
|
||||||
- frtag1
|
- frtag1
|
||||||
|
@ -850,7 +850,7 @@ publishdate: "2000-01-05"
|
||||||
NOTE: should use the DefaultContentLanguage and mark this doc as 'fr'.
|
NOTE: should use the DefaultContentLanguage and mark this doc as 'fr'.
|
||||||
NOTE: doesn't have any corresponding translation in 'en'
|
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
|
title: doc5
|
||||||
publishdate: "2000-01-06"
|
publishdate: "2000-01-06"
|
||||||
---
|
---
|
||||||
|
@ -859,40 +859,40 @@ publishdate: "2000-01-06"
|
||||||
NOTE: should use the "permalinks" configuration with :filename
|
NOTE: should use the "permalinks" configuration with :filename
|
||||||
`)},
|
`)},
|
||||||
// Add some for the stats
|
// Add some for the stats
|
||||||
{filepath.FromSlash("stats/expired.fr.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/expired.fr.md"), Content: []byte(`---
|
||||||
title: expired
|
title: expired
|
||||||
publishdate: "2000-01-06"
|
publishdate: "2000-01-06"
|
||||||
expiryDate: "2001-01-06"
|
expiryDate: "2001-01-06"
|
||||||
---
|
---
|
||||||
# Expired
|
# Expired
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("stats/future.fr.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/future.fr.md"), Content: []byte(`---
|
||||||
title: future
|
title: future
|
||||||
publishdate: "2100-01-06"
|
publishdate: "2100-01-06"
|
||||||
---
|
---
|
||||||
# Future
|
# Future
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("stats/expired.en.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/expired.en.md"), Content: []byte(`---
|
||||||
title: expired
|
title: expired
|
||||||
publishdate: "2000-01-06"
|
publishdate: "2000-01-06"
|
||||||
expiryDate: "2001-01-06"
|
expiryDate: "2001-01-06"
|
||||||
---
|
---
|
||||||
# Expired
|
# Expired
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("stats/future.en.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/future.en.md"), Content: []byte(`---
|
||||||
title: future
|
title: future
|
||||||
publishdate: "2100-01-06"
|
publishdate: "2100-01-06"
|
||||||
---
|
---
|
||||||
# Future
|
# Future
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("stats/draft.en.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/draft.en.md"), Content: []byte(`---
|
||||||
title: expired
|
title: expired
|
||||||
publishdate: "2000-01-06"
|
publishdate: "2000-01-06"
|
||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
# Draft
|
# Draft
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("stats/tax.nn.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/tax.nn.md"), Content: []byte(`---
|
||||||
title: Tax NN
|
title: Tax NN
|
||||||
publishdate: "2000-01-06"
|
publishdate: "2000-01-06"
|
||||||
weight: 1001
|
weight: 1001
|
||||||
|
@ -901,7 +901,7 @@ lag:
|
||||||
---
|
---
|
||||||
# Tax NN
|
# Tax NN
|
||||||
`)},
|
`)},
|
||||||
{filepath.FromSlash("stats/tax.nb.md"), []byte(`---
|
{Name: filepath.FromSlash("stats/tax.nb.md"), Content: []byte(`---
|
||||||
title: Tax NB
|
title: Tax NB
|
||||||
publishdate: "2000-01-06"
|
publishdate: "2000-01-06"
|
||||||
weight: 1002
|
weight: 1002
|
||||||
|
|
|
@ -17,7 +17,6 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
//"sort"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
|
@ -1724,11 +1724,10 @@ func taxonomyRenderer(prepare bool, s *Site, taxes <-chan taxRenderInfo, results
|
||||||
|
|
||||||
if !viper.GetBool("DisableRSS") {
|
if !viper.GetBool("DisableRSS") {
|
||||||
// XML Feed
|
// XML Feed
|
||||||
c := *n
|
rssNode := s.newNode(fmt.Sprintf("%s-%s-rss", t.plural, t.key))
|
||||||
rssNode := &c
|
|
||||||
rssNode.nodeID = ""
|
|
||||||
rssuri := viper.GetString("RSSUri")
|
rssuri := viper.GetString("RSSUri")
|
||||||
s.setURLs(rssNode, base+"/"+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"}
|
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 != "" {
|
if !viper.GetBool("DisableRSS") && section != "" {
|
||||||
// XML Feed
|
// XML Feed
|
||||||
rssuri := viper.GetString("RSSUri")
|
rssuri := viper.GetString("RSSUri")
|
||||||
c := *n
|
rssNode := s.newSectionListNode(true, sectionName+"-rss", section, data, 0)
|
||||||
rssNode := &c
|
|
||||||
s.setURLs(rssNode, section+"/"+rssuri)
|
s.setURLs(rssNode, section+"/"+rssuri)
|
||||||
rssLayouts := []string{"section/" + section + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"}
|
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 {
|
if err := s.renderAndWriteXML("section "+section+" rss", rssNode.addLangPathPrefix(section+"/"+rssuri), rssNode, s.appendThemeTemplates(rssLayouts)...); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue