diff --git a/main.go b/main.go index 81f2424..011673f 100644 --- a/main.go +++ b/main.go @@ -123,7 +123,7 @@ var gogetTemplate = template.Must(template.New("").Parse(` -{{$root := .GitHubRoot}}{{$tree := .GitHubTree}} +{{$root := .GitHubRoot}}{{$tree := .GitHubTree}} go get {{.GopkgPath}} @@ -197,6 +197,22 @@ func (repo *Repo) GitHubRoot() string { return *srcDomainFlag + "/" + repo.User + "/" + repo.Name } +// TreeDir returns the repository's web tree dir +func (repo *Repo) TreeDir() string { + if *srcDomainFlag != "github.com" { + return "src/branch" + } + return "tree" +} + +// BlobDir returns the repository's dir for source files +func (repo *Repo) BlobDir() string { + if *srcDomainFlag != "github.com" { + return "src/branch" + } + return "blob" +} + // GitHubTree returns the repository tree name for the selected version. func (repo *Repo) GitHubTree() string { if repo.FullVersion == InvalidVersion { diff --git a/page.go b/page.go index a6aebcc..0f95b18 100644 --- a/page.go +++ b/page.go @@ -131,7 +131,7 @@ const packageTemplateString = ` {{ end }}
- Source Code + Source Code API Documentation