mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -135,6 +135,8 @@ func serve(port int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fixUrl massages the BaseUrl into a form needed for serving
|
||||||
|
// all pages correctly.
|
||||||
func fixUrl(s string) (string, error) {
|
func fixUrl(s string) (string, error) {
|
||||||
useLocalhost := false
|
useLocalhost := false
|
||||||
if s == "" {
|
if s == "" {
|
||||||
@@ -144,6 +146,9 @@ func fixUrl(s string) (string, error) {
|
|||||||
if !strings.HasPrefix(s, "http://") && !strings.HasPrefix(s, "https://") {
|
if !strings.HasPrefix(s, "http://") && !strings.HasPrefix(s, "https://") {
|
||||||
s = "http://" + s
|
s = "http://" + s
|
||||||
}
|
}
|
||||||
|
if !strings.HasSuffix(s, "/") {
|
||||||
|
s = s + "/"
|
||||||
|
}
|
||||||
u, err := url.Parse(s)
|
u, err := url.Parse(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Reference in New Issue
Block a user