Move to yaml-based configuration
This commit updates the configuration to be yaml-based and updates the configuration to read in a yaml file.
This commit is contained in:
parent
568c005d15
commit
945329a080
70 changed files with 1150 additions and 350 deletions
|
|
@ -51,7 +51,7 @@ func (home *Home) HandleRoute(ctx context.Context, route string) (http.Handler,
|
|||
dflt.Fallback = home.publicHandler(ctx)
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
slug, ok := home.Config.SlugFromHost(r.Host)
|
||||
slug, ok := home.Config.HTTP.SlugFromHost(r.Host)
|
||||
switch {
|
||||
case !ok:
|
||||
http.NotFound(w, r)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ func (home *Home) publicHandler(ctx context.Context) http.Handler {
|
|||
// prepare about
|
||||
pc.aboutContext.Logo = logoHTML
|
||||
pc.aboutContext.Instances = home.homeInstances.Get(nil)
|
||||
pc.aboutContext.SelfRedirect = home.Config.SelfRedirect.String()
|
||||
pc.aboutContext.SelfRedirect = home.Config.Theme.SelfRedirect.String()
|
||||
|
||||
// render the about template
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ func (home *Home) loadRedirect(ctx context.Context) (redirect Redirect, err erro
|
|||
redirect.Permanent = false
|
||||
|
||||
// load the overrides file
|
||||
overrides, err := home.Environment.Open(home.Config.SelfOverridesFile)
|
||||
overrides, err := home.Environment.Open(home.Config.Paths.OverridesJSON)
|
||||
if err != nil {
|
||||
return redirect, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue