Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Friend <nathan@gitlab.com>2021-08-20 13:52:09 +0300
committerNathan Friend <nathan@gitlab.com>2021-08-20 13:52:09 +0300
commit5fff32dd852a27151a08dea0cb2a8fd2983d7f65 (patch)
tree0e5c56af88f83f1550bbaf90f433eda4da7cfd5d /internal/redirects/helpers.go
parentca330e78ad92ea79939a5df9b70f3c627a62eecf (diff)
Splat and placeholder support in _redirects
This commit adds support for Netlify-style splats (*) and :placeholders in the _redirects file. Changelog: added
Diffstat (limited to 'internal/redirects/helpers.go')
-rw-r--r--internal/redirects/helpers.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/redirects/helpers.go b/internal/redirects/helpers.go
index 4223faae..52ae7991 100644
--- a/internal/redirects/helpers.go
+++ b/internal/redirects/helpers.go
@@ -1,6 +1,7 @@
package redirects
import (
+ "os"
"strings"
)
@@ -9,3 +10,9 @@ import (
func normalizePath(path string) string {
return strings.TrimSuffix(path, "/") + "/"
}
+
+// placeholdersEnabled returns whether or not placeholders and splats
+// are enabled for use in the _redirects file.
+func placeholdersEnabled() bool {
+ return os.Getenv(FFEnablePlaceholders) == "true"
+}