aboutsummaryrefslogtreecommitdiffhomepage
path: root/common/paths
diff options
context:
space:
mode:
authorOleksandr Redko <[email protected]>2023-10-04 22:25:43 +0300
committerBjørn Erik Pedersen <[email protected]>2023-10-05 14:45:55 +0200
commit274852bcf254230fae30bed4883049ec94462e85 (patch)
treea8276d0c666d8fb16ba832d932c77c3458a1824b /common/paths
parent37a2d5eb4e99b102ba39616917a4c76cb8a142a7 (diff)
downloadhugo-274852bcf254230fae30bed4883049ec94462e85.tar.gz
hugo-274852bcf254230fae30bed4883049ec94462e85.zip
all: Format files with gofmt
Diffstat (limited to 'common/paths')
-rw-r--r--common/paths/url.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/common/paths/url.go b/common/paths/url.go
index c538d8f2c..cefefdf11 100644
--- a/common/paths/url.go
+++ b/common/paths/url.go
@@ -51,9 +51,10 @@ var pb pathBridge
// MakePermalink combines base URL with content path to create full URL paths.
// Example
-// base: http://spf13.com/
-// path: post/how-i-blog
-// result: http://spf13.com/post/how-i-blog
+//
+// base: http://spf13.com/
+// path: post/how-i-blog
+// result: http://spf13.com/post/how-i-blog
func MakePermalink(host, plink string) *url.URL {
base, err := url.Parse(host)
if err != nil {
@@ -117,17 +118,19 @@ func PrettifyURL(in string) string {
// PrettifyURLPath takes a URL path to a content and converts it
// to enable pretty URLs.
-// /section/name.html becomes /section/name/index.html
-// /section/name/ becomes /section/name/index.html
-// /section/name/index.html becomes /section/name/index.html
+//
+// /section/name.html becomes /section/name/index.html
+// /section/name/ becomes /section/name/index.html
+// /section/name/index.html becomes /section/name/index.html
func PrettifyURLPath(in string) string {
return prettifyPath(in, pb)
}
// Uglify does the opposite of PrettifyURLPath().
-// /section/name/index.html becomes /section/name.html
-// /section/name/ becomes /section/name.html
-// /section/name.html becomes /section/name.html
+//
+// /section/name/index.html becomes /section/name.html
+// /section/name/ becomes /section/name.html
+// /section/name.html becomes /section/name.html
func Uglify(in string) string {
if path.Ext(in) == "" {
if len(in) < 2 {