Add Translations and AllTranslations to Node

This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.
This commit is contained in:
Bjørn Erik Pedersen
2016-07-26 19:04:10 +02:00
parent 52bf8f9095
commit 3a02807970
7 changed files with 162 additions and 74 deletions

View File

@@ -1448,7 +1448,10 @@ NOTE: should use the "permalinks" configuration with :filename
permalink, err = doc3.Permalink()
assert.NoError(t, err, "permalink call failed")
assert.Equal(t, "http://example.com/blog/superbob", permalink, "invalid doc3 permalink")
assert.Equal(t, "/superbob", doc3.URL, "invalid url, was specified on doc3")
// TODO(bep) multilingo. Check this case. This has url set in frontmatter, but we must split into lang folders
// The assertion below was missing the /en prefix.
assert.Equal(t, "/en/superbob", doc3.URL(), "invalid url, was specified on doc3 TODO(bep)")
assert.Equal(t, doc2.Next, doc3, "doc3 should follow doc2, in .Next")