Skip to content

Commit

Permalink
Merge pull request #361 from Kostov6/enh/resource-website-path
Browse files Browse the repository at this point in the history
Add `resource-website-path`
  • Loading branch information
RadaBDimitrova authored Dec 11, 2024
2 parents f2b64cd + b33cf71 commit d36c4b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/app/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func exec(ctx context.Context) error {
if err != nil {
return err
}
docProcessor, docTasks, err := document.New(config.DocumentWorkersCount, config.FailFast, reactorWG, documentNodes, config.ResourcesPath, dScheduler, v, rhRegistry, config.Hugo, config.Writer, config.SkipLinkValidation)
docProcessor, docTasks, err := document.New(config.DocumentWorkersCount, config.FailFast, reactorWG, documentNodes, config.ResourcesWebsitePath, dScheduler, v, rhRegistry, config.Hugo, config.Writer, config.SkipLinkValidation)
if err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/app/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func configureFlags(command *cobra.Command) {
"Resources download path.")
_ = vip.BindPFlag("resources-download-path", command.Flags().Lookup("resources-download-path"))

command.Flags().String("resources-website-path", "__resources",
"The path in the website where resources will be accessed through.")
_ = vip.BindPFlag("resources-website-path", command.Flags().Lookup("resources-website-path"))

command.Flags().StringToString("github-oauth-token-map", map[string]string{},
"GitHub personal tokens authorizing read access from repositories per GitHub instance. Note that if the GitHub token is already provided by `github-oauth-token` it will be overridden by it.")
_ = vip.BindPFlag("github-oauth-token-map", command.Flags().Lookup("github-oauth-token-map"))
Expand Down
2 changes: 1 addition & 1 deletion cmd/app/initilization.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func getReactorConfig(options Options, hugo hugo.Hugo, rhs []repositoryhost.Inte
Hugo: config.Hugo.Enabled,
}
config.ResourceDownloadWriter = &writers.FSWriter{
Root: filepath.Join(config.DestinationPath, config.ResourcesPath),
Root: filepath.Join(config.DestinationPath, config.ResourcesDownloadPath),
}

if len(config.GhInfoDestination) > 0 {
Expand Down
3 changes: 2 additions & 1 deletion cmd/app/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ type Options struct {
ValidationWorkersCount int `mapstructure:"validation-workers"`
FailFast bool `mapstructure:"fail-fast"`
DestinationPath string `mapstructure:"destination"`
ResourcesPath string `mapstructure:"resources-download-path"`
ResourcesDownloadPath string `mapstructure:"resources-download-path"`
ResourcesWebsitePath string `mapstructure:"resources-website-path"`
ManifestPath string `mapstructure:"manifest"`
ResourceDownloadWorkersCount int `mapstructure:"download-workers"`
GhInfoDestination string `mapstructure:"github-info-destination"`
Expand Down

0 comments on commit d36c4b4

Please sign in to comment.