Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugins/github_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/google/go-github/github"
"github.com/osteele/gojekyll/config"
"github.com/osteele/gojekyll/logger"
"github.com/osteele/liquid"
"golang.org/x/oauth2"
)
Expand All @@ -23,18 +24,21 @@ func init() {
type jekyllGithubMetadataPlugin struct{ plugin }

func (p jekyllGithubMetadataPlugin) ModifySiteDrop(s Site, d map[string]interface{}) error {
log := logger.Default()
var (
cfg = s.Config()
isUserPage = false
ref = "master"
)
nwo, err := getCurrentRepo(cfg)
if err != nil {
return err
log.Warn("jekyll-github-metadata: can't determine current repository: %s", err)
return nil
}
repo, err := getGitHubRepo(nwo)
if err != nil {
return err
log.Warn("jekyll-github-metadata: can't fetch repository %q from GitHub: %s", nwo, err)
return nil
}
if *repo.Name == fmt.Sprintf("%s.github.com", strings.ToLower(*repo.Owner.Login)) {
isUserPage = true
Expand Down