"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hugolib/site_test.go" between
hugo-0.80.0.tar.gz and hugo-0.81.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

site_test.go  (hugo-0.80.0):site_test.go  (hugo-0.81.0)
skipping to change at line 25 skipping to change at line 25
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"testing" "testing"
"github.com/gobuffalo/flect"
"github.com/gohugoio/hugo/publisher" "github.com/gohugoio/hugo/publisher"
"github.com/spf13/viper" "github.com/spf13/viper"
"github.com/markbates/inflect"
qt "github.com/frankban/quicktest" qt "github.com/frankban/quicktest"
"github.com/gohugoio/hugo/deps" "github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/resources/page" "github.com/gohugoio/hugo/resources/page"
) )
const ( const (
templateMissingFunc = "{{ .Title | funcdoesnotexists }}" templateMissingFunc = "{{ .Title | funcdoesnotexists }}"
templateWithURLAbs = "<a href=\"/foobar.jpg\">Going</a>" templateWithURLAbs = "<a href=\"/foobar.jpg\">Going</a>"
) )
skipping to change at line 490 skipping to change at line 489
{filepath.FromSlash(fmt.Sprintf("sect%s", expectedPathSuffix)), t rue, "Sect"}, {filepath.FromSlash(fmt.Sprintf("sect%s", expectedPathSuffix)), t rue, "Sect"},
{filepath.FromSlash(fmt.Sprintf("fish-and-chips/doc2%s", expected PathSuffix)), false, "doc2"}, {filepath.FromSlash(fmt.Sprintf("fish-and-chips/doc2%s", expected PathSuffix)), false, "doc2"},
{filepath.FromSlash(fmt.Sprintf("fish-and-chips%s", expectedPathS uffix)), true, "Fish and Chips"}, {filepath.FromSlash(fmt.Sprintf("fish-and-chips%s", expectedPathS uffix)), true, "Fish and Chips"},
{filepath.FromSlash(fmt.Sprintf("ラーメン/doc3%s", expectedPathSuffix )), false, "doc3"}, {filepath.FromSlash(fmt.Sprintf("ラーメン/doc3%s", expectedPathSuffix )), false, "doc3"},
{filepath.FromSlash(fmt.Sprintf("ラーメン%s", expectedPathSuffix)), t rue, "ラーメン"}, {filepath.FromSlash(fmt.Sprintf("ラーメン%s", expectedPathSuffix)), t rue, "ラーメン"},
} }
for _, test := range tests { for _, test := range tests {
if test.pluralAware && pluralize { if test.pluralAware && pluralize {
test.expected = inflect.Pluralize(test.expected) test.expected = flect.Pluralize(test.expected)
} }
th.assertFileContent(filepath.Join("public", test.doc), test.expe cted) th.assertFileContent(filepath.Join("public", test.doc), test.expe cted)
} }
} }
func TestAbsURLify(t *testing.T) { func TestAbsURLify(t *testing.T) {
t.Parallel() t.Parallel()
sources := [][2]string{ sources := [][2]string{
{filepath.FromSlash("sect/doc1.html"), "<!doctype html><html><hea d></head><body><a href=\"#frag1\">link</a></body></html>"}, {filepath.FromSlash("sect/doc1.html"), "<!doctype html><html><hea d></head><body><a href=\"#frag1\">link</a></body></html>"},
skipping to change at line 586 skipping to change at line 585
title = "Four" title = "Four"
date = "2012-01-01" date = "2012-01-01"
publishdate = "2012-01-01" publishdate = "2012-01-01"
my_param = "baz" my_param = "baz"
my_date = 2010-05-27T07:32:00Z my_date = 2010-05-27T07:32:00Z
summary = "A _custom_ summary" summary = "A _custom_ summary"
categories = [ "hugo" ] categories = [ "hugo" ]
+++ +++
Front Matter with Ordered Pages 4. This is longer content` Front Matter with Ordered Pages 4. This is longer content`
var weightedPage5 = `+++
weight = "5"
title = "Five"
[_build]
render = "never"
Front Matter with Ordered Pages 5`
var weightedSources = [][2]string{ var weightedSources = [][2]string{
{filepath.FromSlash("sect/doc1.md"), weightedPage1}, {filepath.FromSlash("sect/doc1.md"), weightedPage1},
{filepath.FromSlash("sect/doc2.md"), weightedPage2}, {filepath.FromSlash("sect/doc2.md"), weightedPage2},
{filepath.FromSlash("sect/doc3.md"), weightedPage3}, {filepath.FromSlash("sect/doc3.md"), weightedPage3},
{filepath.FromSlash("sect/doc4.md"), weightedPage4}, {filepath.FromSlash("sect/doc4.md"), weightedPage4},
{filepath.FromSlash("sect/doc5.md"), weightedPage5},
} }
func TestOrderedPages(t *testing.T) { func TestOrderedPages(t *testing.T) {
t.Parallel() t.Parallel()
cfg, fs := newTestCfg() cfg, fs := newTestCfg()
cfg.Set("baseURL", "http://auth/bub") cfg.Set("baseURL", "http://auth/bub")
for _, src := range weightedSources { for _, src := range weightedSources {
writeSource(t, fs, filepath.Join("content", src[0]), src[1]) writeSource(t, fs, filepath.Join("content", src[0]), src[1])
} }
 End of changes. 5 change blocks. 
3 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)