pkg

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func DefaultProcessor

func DefaultProcessor(sourcesPath, targetFolderPathForBuild string)

func GitHubWebHookHandler

func GitHubWebHookHandler(resp http.ResponseWriter, req *http.Request)

func HugoProcessor

func HugoProcessor(sourcesPath, targetFolderPathForBuild string) error

func IndexForSearch

func IndexForSearch(targetFolderPathForBuild string) error

func InitialiseConfiguration

func InitialiseConfiguration(configFilePath string) error

func InitialiseRegistry

func InitialiseRegistry(sourceRoot string, docsRoot string, githubWebHookSecretEnvKey string)

func SetLogger

func SetLogger(logger *zap.SugaredLogger)

Types

type GitRepoConfig

type GitRepoConfig struct {
	CloneId  string `yaml:"clone_id"`
	RepoName string `yaml:"repo_name"`
	Branch   string `yaml:"branch"`
}

type SheepstorConfiguration

type SheepstorConfiguration struct {
	SourceRoot                string          `yaml:"source_root"`
	DocsRoot                  string          `yaml:"docs_root"`
	GitHubWebHookSecretEnvKey string          `yaml:"github_webhook_secret_env_key"`
	WebsiteConfigs            []WebsiteConfig `yaml:"websites"`
}

type Website

type Website struct {
	ID               string
	ContentProcessor string //either 'hugo' or nil
	ProcessorRoot    string
	WebRoot          string
	IndexForSearch   bool
	GitRepo          toolbox2go.GitRepo
}

func NewWebsite

func NewWebsite(id, contentProcessor, processorRoot, sourceRoot, webRoot, repoCloneID, repoName, repoBranchName string, indexForSearch bool) Website

func (*Website) Build

func (w *Website) Build() error

func (*Website) CommitAndPush

func (w *Website) CommitAndPush(message string) error

func (*Website) ProvisionSources

func (w *Website) ProvisionSources() error

type WebsiteConfig

type WebsiteConfig struct {
	ID                         string        `yaml:"id"`
	ContentProcessor           string        `yaml:"content_processor"` //either 'hugo' or nil
	ProcessorRootSubFolderPath string        `yaml:"processor_root"`    //e.g. a sub-folder in the repo called 'webroot'
	IndexForSearch             bool          `yaml:"index"`             //run the pagefind executable to create a search index
	GitRepoConfig              GitRepoConfig `yaml:"git"`
}

type WebsiteRegistry

type WebsiteRegistry struct {
	SourceRoot          string
	WebRoot             string
	GitHubWebHookSecret string
	WebSites            []*Website
}
var Registry WebsiteRegistry

func NewRegistry

func NewRegistry(sourceRoot, webRoot, gitHubWebHookSecret string) WebsiteRegistry

func (*WebsiteRegistry) Add

func (r *WebsiteRegistry) Add(w *Website)

func (*WebsiteRegistry) GetWebsiteByID

func (r *WebsiteRegistry) GetWebsiteByID(id string) *Website

func (*WebsiteRegistry) GetWebsiteByRepoNameAndBranchRef

func (r *WebsiteRegistry) GetWebsiteByRepoNameAndBranchRef(repoName, branchRef string) *Website

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL