mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
@@ -14,6 +14,7 @@
|
||||
package create_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -23,8 +24,6 @@ import (
|
||||
|
||||
"github.com/gohugoio/hugo/hugolib"
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
qt "github.com/frankban/quicktest"
|
||||
@@ -35,7 +34,6 @@ import (
|
||||
)
|
||||
|
||||
func TestNewContent(t *testing.T) {
|
||||
|
||||
cases := []struct {
|
||||
kind string
|
||||
path string
|
||||
@@ -59,7 +57,8 @@ func TestNewContent(t *testing.T) {
|
||||
`title = "GO"`,
|
||||
"{{< myshortcode >}}",
|
||||
"{{% myshortcode %}}",
|
||||
"{{</* comment */>}}\n{{%/* comment */%}}"}}, // shortcodes
|
||||
"{{</* comment */>}}\n{{%/* comment */%}}",
|
||||
}}, // shortcodes
|
||||
}
|
||||
|
||||
for i, cas := range cases {
|
||||
@@ -140,7 +139,6 @@ i18n: {{ T "hugo" }}
|
||||
c.Assert(create.NewContent(h, "my-theme-bundle", "post/my-theme-post"), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/index.md")), `File: index.md`, `Site Lang: en`, `Name: My Theme Post`, `i18n: Hugo Rocks!`)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/resources/hugo1.json")), `hugo1: {{ printf "no template handling in here" }}`)
|
||||
|
||||
}
|
||||
|
||||
func initFs(fs afero.Fs) error {
|
||||
@@ -248,7 +246,6 @@ func readFileFromFs(t *testing.T, fs afero.Fs, filename string) string {
|
||||
}
|
||||
|
||||
func newTestCfg(c *qt.C, mm afero.Fs) (*viper.Viper, *hugofs.Fs) {
|
||||
|
||||
cfg := `
|
||||
|
||||
theme = "mytheme"
|
||||
@@ -281,5 +278,4 @@ other = "Hugo Rokkar!"`), 0755), qt.IsNil)
|
||||
c.Assert(err, qt.IsNil)
|
||||
|
||||
return v, hugofs.NewFrom(mm, v)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user