Documentation ¶
Index ¶
- func CheckErr(err error)
- func PathWithoutVersion(s string) string
- type Client
- func (c *Client) CreateThemesConfig() error
- func (c *Client) GetGitHubRepos(mods ModulesMap, cleanCache bool) (map[string]GitHubRepo, error)
- func (c *Client) GetHugoModulesMap(config string) (ModulesMap, error)
- func (c *Client) InitModule() error
- func (c *Client) IsBadURL(s string) bool
- func (c *Client) JoinOutPath(elem ...string) string
- func (c *Client) Logf(format string, a ...interface{})
- func (c *Client) OutFileExists(name string) bool
- func (c *Client) RunHugo(arg ...string) error
- func (c *Client) TimeTrack(start time.Time, name string)
- type GitHubRepo
- type HugoVersion
- type Module
- type ModulesMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathWithoutVersion ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateThemesConfig ¶
CreateThemesConfig reads themes.txt and creates a config.json suitable for Hugo. Note that we're only using that config to get the full module listing.
func (*Client) GetGitHubRepos ¶
func (c *Client) GetGitHubRepos(mods ModulesMap, cleanCache bool) (map[string]GitHubRepo, error)
GetGitHubRepos will first look in the chache folder for GitHub repo information for mods. If not found, it will ask GitHub and then store it in the cache.
If you start with an empty cache, you will need to set a GITHUB_TOKEN environment variable.
func (*Client) GetHugoModulesMap ¶
func (c *Client) GetHugoModulesMap(config string) (ModulesMap, error)
func (*Client) InitModule ¶
func (*Client) JoinOutPath ¶
func (*Client) OutFileExists ¶
type GitHubRepo ¶
type GitHubRepo struct { ID int `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name"` Description string `json:"description"` HTMLURL string `json:"html_url"` Stars int `json:"stargazers_count"` }
func (GitHubRepo) IsZero ¶
func (g GitHubRepo) IsZero() bool
type HugoVersion ¶
HugoVersion holds Hugo binary version requirements for a module.
type Module ¶
type Module struct { Path string `json:"path"` Owner string `json:"owner"` Version string `json:"version"` Time time.Time `json:"time"` Dir string `json:"dir"` HugoVersion HugoVersion `json:"hugoVersion"` Meta map[string]interface{} `json:"meta"` }
func (Module) PathWithoutVersion ¶
type ModulesMap ¶
Click to show internal directories.
Click to hide internal directories.