mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 16:17:21 +00:00
1 parent
3cee9b7786
commit
be0903c71a
2 files changed
+10
-5
No files matched your search
+1
-1
@@ -800,7 +800,7 @@ func (p *Page) Convert() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Page) FullFilePath() string {
|
func (p *Page) FullFilePath() string {
|
||||||
return filepath.Join(p.Source.Dir(), p.Source.Path())
|
return filepath.Join(p.Dir(), p.LogicalName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Page) TargetPath() (outfile string) {
|
func (p *Page) TargetPath() (outfile string) {
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ func TestSliceToLower(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTargetPath(t *testing.T) {
|
func TestPagePaths(t *testing.T) {
|
||||||
viper.Reset()
|
viper.Reset()
|
||||||
defer viper.Reset()
|
defer viper.Reset()
|
||||||
|
|
||||||
@@ -700,10 +700,15 @@ func TestTargetPath(t *testing.T) {
|
|||||||
p.Node.Site.Permalinks = site_permalinks_setting
|
p.Node.Site.Permalinks = site_permalinks_setting
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := filepath.FromSlash(test.expected)
|
expectedTargetPath := filepath.FromSlash(test.expected)
|
||||||
|
expectedFullFilePath := filepath.FromSlash(test.path)
|
||||||
|
|
||||||
if p.TargetPath() != expected {
|
if p.TargetPath() != expectedTargetPath {
|
||||||
t.Errorf("%s => TargetPath expected: '%s', got: '%s'", test.content, expected, p.TargetPath())
|
t.Errorf("%s => TargetPath expected: '%s', got: '%s'", test.content, expectedTargetPath, p.TargetPath())
|
||||||
|
}
|
||||||
|
|
||||||
|
if p.FullFilePath() != expectedFullFilePath {
|
||||||
|
t.Errorf("%s => FullFilePath expected: '%s', got: '%s'", test.content, expectedFullFilePath, p.FullFilePath())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user