mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
refactor: rename buf-publish.yml to publish-assets.yml
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
import "https://pkl.sh/uiux.pkl";
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
type Button struct {
|
||||
Text string `pkl:"text"`
|
||||
|
||||
Href string `pkl:"href"`
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
type Hero struct {
|
||||
TitleFirst string `pkl:"titleFirst"`
|
||||
|
||||
TitleEmphasis string `pkl:"titleEmphasis"`
|
||||
|
||||
TitleSecond string `pkl:"titleSecond"`
|
||||
|
||||
Subtitle string `pkl:"subtitle"`
|
||||
|
||||
PrimaryButton *Button `pkl:"primaryButton"`
|
||||
|
||||
SecondaryButton *Button `pkl:"secondaryButton"`
|
||||
|
||||
Image *Image `pkl:"image"`
|
||||
|
||||
Stats []*Stat `pkl:"stats"`
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
type Image struct {
|
||||
Src string `pkl:"src"`
|
||||
|
||||
Width int `pkl:"width"`
|
||||
|
||||
Height int `pkl:"height"`
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
type Link struct {
|
||||
Text string `pkl:"text"`
|
||||
|
||||
Href string `pkl:"href"`
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/apple/pkl-go/pkl"
|
||||
)
|
||||
|
||||
type Models struct {
|
||||
}
|
||||
|
||||
// LoadFromPath loads the pkl module at the given path and evaluates it into a Models
|
||||
func LoadFromPath(ctx context.Context, path string) (ret *Models, err error) {
|
||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
cerr := evaluator.Close()
|
||||
if err == nil {
|
||||
err = cerr
|
||||
}
|
||||
}()
|
||||
ret, err = Load(ctx, evaluator, pkl.FileSource(path))
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// LoadFromURL loads the pkl module at the given URL and evaluates it into a Models
|
||||
func LoadFromURL(ctx context.Context, url string) (ret *Models, err error) {
|
||||
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
cerr := evaluator.Close()
|
||||
if err == nil {
|
||||
err = cerr
|
||||
}
|
||||
}()
|
||||
ret, err = Load(ctx, evaluator, pkl.UriSource(url))
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Models
|
||||
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Models, error) {
|
||||
var ret Models
|
||||
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ret, nil
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
type SocialLink struct {
|
||||
Link *Link `pkl:"link"`
|
||||
|
||||
Icon string `pkl:"icon"`
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
type Stat struct {
|
||||
Value string `pkl:"value"`
|
||||
|
||||
Label string `pkl:"label"`
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
package models
|
||||
@@ -0,0 +1,14 @@
|
||||
// Code generated from Pkl module `models`. DO NOT EDIT.
|
||||
package models
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
||||
func init() {
|
||||
pkl.RegisterMapping("models", Models{})
|
||||
pkl.RegisterMapping("models#Image", Image{})
|
||||
pkl.RegisterMapping("models#Link", Link{})
|
||||
pkl.RegisterMapping("models#SocialLink", SocialLink{})
|
||||
pkl.RegisterMapping("models#Button", Button{})
|
||||
pkl.RegisterMapping("models#Stat", Stat{})
|
||||
pkl.RegisterMapping("models#Hero", Hero{})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
package models
|
||||
@@ -11,6 +11,9 @@ import (
|
||||
//go:embed assets
|
||||
var embeddedFiles embed.FS
|
||||
|
||||
//go:embed assets/config.pkl
|
||||
var config []byte
|
||||
|
||||
func getHTTPFS() (http.FileSystem, error) {
|
||||
fsys, err := fs.Sub(embeddedFiles, "assets")
|
||||
if err != nil {
|
||||
@@ -30,3 +33,8 @@ func UseAssets(e *echo.Echo) error {
|
||||
e.GET("/assets/*", echo.WrapHandler(http.StripPrefix("/assets/", assets)))
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetConfig is a middleware that serves the config file
|
||||
func GetConfig(e echo.Context) error {
|
||||
return e.Blob(http.StatusOK, "application/octet-stream", config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user