File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package main
22
33import (
44 "context"
5- "encoding/json"
65 "flag"
76 "fmt"
87 "io"
@@ -14,7 +13,6 @@ import (
1413 "github.com/pkg/errors"
1514 "go.uber.org/zap"
1615 "gopkg.d7z.net/gitea-pages/pkg"
17- "gopkg.d7z.net/gitea-pages/pkg/core"
1816 "gopkg.d7z.net/gitea-pages/pkg/providers"
1917 "gopkg.d7z.net/middleware/cache"
2018 "gopkg.d7z.net/middleware/kv"
@@ -60,13 +58,13 @@ func main() {
6058
6159 file , _ := os .ReadFile (filepath .Join (path , ".pages.yaml" ))
6260 if file != nil {
63- var info core. PageConfig
61+ var info map [ string ] interface {}
6462 err := yaml .Unmarshal (file , & info )
6563 if err != nil {
6664 zap .L ().Fatal ("parse yaml" , zap .Error (err ))
6765 }
68- info . Alias = [] string {}
69- marshal , _ := json .Marshal (info )
66+ delete ( info , "alias" )
67+ marshal , _ := yaml .Marshal (info )
7068 provider .AddOverlay (".pages.yaml" , marshal )
7169 }
7270 memory , err := kv .NewMemory ("" )
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func (p *PageConfigRoute) UnmarshalYAML(value *yaml.Node) error {
3232 keys = append (keys , k )
3333 }
3434 if len (keys ) != 1 {
35- return errors .New ("invalid param" )
35+ return errors .Errorf ("invalid param: %v" , keys )
3636 }
3737 p .Type = keys [0 ]
3838 params := data [p .Type ]
You can’t perform that action at this time.
0 commit comments