#13 GitHub Handle
This commit is contained in:
parent
ecfcd84b82
commit
a8998068ad
|
@ -76,6 +76,7 @@ var webmentionCmd = &cobra.Command{
|
|||
return
|
||||
}
|
||||
processPost(user, &post)
|
||||
return
|
||||
}
|
||||
|
||||
posts, err := user.Posts()
|
||||
|
|
|
@ -44,7 +44,12 @@
|
|||
<nav>
|
||||
<ul>
|
||||
{{ if .UserConfig.TwitterHandle}}
|
||||
<li><a href="https://twitter.com/{{.UserConfig.TwitterHandle}}" rel="me">@{{.UserConfig.TwitterHandle}} on Twitter</a></li>
|
||||
<li><a href="https://twitter.com/{{.UserConfig.TwitterHandle}}" rel="me">@{{.UserConfig.TwitterHandle}} on Twitter</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .UserConfig.GitHubHandle}}
|
||||
<li><a href="https://github.com/{{.UserConfig.GitHubHandle}}" rel="me">@{{.UserConfig.GitHubHandle}} on GitHub</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -44,6 +44,25 @@ func TestRenderTwitterHandle(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
func TestRenderGitHubHandle(t *testing.T) {
|
||||
user := getTestUser()
|
||||
config, _ := user.Config()
|
||||
config.GitHubHandle = "testhandle"
|
||||
user.SetConfig(config)
|
||||
post, _ := user.CreateNewPost("testpost")
|
||||
result, err := owl.RenderPost(&post)
|
||||
|
||||
if err != nil {
|
||||
t.Error("Error rendering post: " + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if !strings.Contains(result, "href=\"https://github.com/testhandle\" rel=\"me\"") {
|
||||
t.Error("GitHub handle not rendered. Got: " + result)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestRenderPostHEntry(t *testing.T) {
|
||||
user := getTestUser()
|
||||
post, _ := user.CreateNewPost("testpost")
|
||||
|
|
Loading…
Reference in New Issue