Move WissKI Parts to new ingredients system

This commit is contained in:
Tom Wiesing 2022-10-18 10:44:39 +02:00
parent b5b1ce2340
commit 42b8cbd865
No known key found for this signature in database
83 changed files with 1016 additions and 646 deletions

View file

@ -0,0 +1,29 @@
package liquid
import (
"fmt"
"net/url"
)
// Domain returns the full domain name of this WissKI
func (liquid *Liquid) Domain() string {
return fmt.Sprintf("%s.%s", liquid.Slug, liquid.Malt.Config.DefaultDomain)
}
// URL returns the public URL of this instance
func (liquid *Liquid) URL() *url.URL {
// setup domain and path
url := &url.URL{
Host: liquid.Domain(),
Path: "/",
}
// use http or https scheme depending on if the distillery has it enabled
if liquid.Malt.Config.HTTPSEnabled() {
url.Scheme = "https"
} else {
url.Scheme = "http"
}
return url
}