mc-webserver/conf/page.go
Captain ALM a159096c89
Some checks are pending
ci/woodpecker/push/build Pipeline is pending
Make server more page versatile.
Update page layout.
2023-09-09 15:57:11 +01:00

20 lines
350 B
Go

package conf
import "strings"
type PageYaml struct {
PageName string `yaml:"pageName"`
PagePath string `yaml:"pagePath"`
}
func (py PageYaml) GetPagePath() string {
toReturn := py.PagePath
if !strings.HasSuffix(toReturn, ".go") {
toReturn += ".go"
}
if !strings.HasPrefix(toReturn, "/") {
toReturn = "/" + toReturn
}
return toReturn
}