提交 8f6d6653 作者: Brian Tiger Chow

feat(tour) initial content

@jbenet please review

If this is a desirable format, I will put in the rest so we can start to
make incrementatl progress on the actual copy.

Separated content from topic so Ids can be seen and modified without
excessive scrolling. Hopefully will make it easy to re-order content.
上级 5335417d
package tour
import "sort"
import (
"sort"
c "github.com/jbenet/go-ipfs/tour/content"
)
func init() {
for _, t := range allTopics {
......@@ -14,13 +18,15 @@ func init() {
// Topics contains a mapping of Tour Topic ID to Topic
var allTopics = []Topic{
Topic{
ID: ID("0"),
Title: "Hello Mars",
Text: "Hello Mars",
ID: ID("0.0"),
Content: c.IntroHelloMars,
},
Topic{
ID: ID("0.1"),
Content: c.IntroTour,
},
Topic{
ID: ID("0.1"),
Title: "Hello Mars 2",
Text: "Hello Mars 2",
ID: ID("0.2"),
Content: c.IntroAboutIpfs,
},
}
package content
var IntroHelloMars = Content{
Title: "Hello Mars",
Text: `
check things work
`,
}
var IntroTour = Content{
Title: "Hello Mars",
Text: `
how this works
`,
}
var IntroAboutIpfs = Content{
Title: "About IPFS",
}
......@@ -4,6 +4,7 @@ import (
"strconv"
"strings"
content "github.com/jbenet/go-ipfs/tour/content"
u "github.com/jbenet/go-ipfs/util"
)
......@@ -26,9 +27,8 @@ func (a IDSlice) Less(i, j int) bool { return a[i].LessThan(a[j]) }
// Topic is a type of objects that structures a tour topic.
type Topic struct {
ID ID
Title string
Text string
ID ID
content.Content
}
// Topics is a sorted list of topic IDs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论