Skip to content

Commit

Permalink
Merge pull request #10 from christopherhein/bug/repo-name-not-included
Browse files Browse the repository at this point in the history
using repo name in go-source
  • Loading branch information
christopherhein authored Dec 4, 2019
2 parents 5c7d8a5 + 79e2de4 commit dbc82e3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions go-path-router/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (
const tpl = `<html>
<head>
<meta name="go-import"
content="{{.Domain}}
git https://{{.CodePath}}/{{.RepoPath}}">
content="{{.Domain}}/{{.Repo}}
git https://{{.CodePath}}/{{.Repo}}">
<meta name="go-source"
content="{{.Domain}}
https://{{.CodePath}}/{{.RepoPath}}
https://{{.CodePath}}/{{.RepoPath}}/tree/master{/dir}
https://{{.CodePath}}/{{.RepoPath}}/blob/master{/dir}/{file}#L{line}">
content="{{.Domain}}/{{.Repo}}
https://{{.CodePath}}/{{.Repo}}
https://{{.CodePath}}/{{.Repo}}/tree/master{/dir}
https://{{.CodePath}}/{{.Repo}}/blob/master{/dir}/{file}#L{line}">
<meta http-equiv="refresh" content="1; url=https://godoc.org/{{.Domain}}{{.Path}}/">
</head>
<body>
Expand All @@ -32,7 +32,7 @@ type goHTMLData struct {
Domain string
CodePath string
Path string
RepoPath string
Repo string
}

func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
Expand All @@ -41,7 +41,7 @@ func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyRespo
Domain: os.Getenv("DOMAIN"),
CodePath: os.Getenv("CODEPATH"),
Path: request.Path,
RepoPath: pathsplit[1],
Repo: pathsplit[1],
}

t, err := template.New("index").Parse(tpl)
Expand Down

0 comments on commit dbc82e3

Please sign in to comment.