ytdl-web/pkg/views/helpers.go

14 lines
287 B
Go

package views
import (
"context"
"strings"
"github.com/a-h/templ"
"go.fifitido.net/ytdl-web/pkg/serverctx"
)
func pathTo(ctx context.Context, path ...string) templ.SafeURL {
return templ.SafeURL(serverctx.BasePath(ctx) + "/" + strings.TrimPrefix(strings.Join(path, "/"), "/"))
}