Skip to content

Commit 2c4d1c4

Browse files
authored
Support disabling all extensions (#90)
1 parent 36c163c commit 2c4d1c4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

extensions.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ func RegisterExtension(e Extension) {
1818
}
1919

2020
func initExtensions() {
21+
if Config.DisabledExtensions == "all" {
22+
slog.Info("extensions", "disabled", "all")
23+
return
24+
}
25+
2126
disabled := strings.Split(Config.DisabledExtensions, ",")
2227
disabledNames := []string{} // because the user can input wrong extension name
2328
enabledNames := []string{}

flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func init() {
3636
flag.StringVar(&Config.BindAddress, "bind", "127.0.0.1:3000", "IP and port to bind the web server to")
3737
flag.BoolVar(&Config.ServeInsecure, "serve-insecure", false, "Accept http connections and forward crsf cookie over non secure connections")
3838
flag.StringVar(&Config.CsrfCookieName, "csrf-cookie", "xlog_csrf", "CSRF cookie name")
39-
flag.StringVar(&Config.DisabledExtensions, "disabled-extensions", "", "disable list of extensions by name, comma separated")
39+
flag.StringVar(&Config.DisabledExtensions, "disabled-extensions", "", "disable list of extensions by name, comma separated, `all` will disable all extensions")
4040
flag.StringVar(&Config.CodeStyle, "codestyle", "dracula", "code highlighting style name from the list supported by https://pkg.go.dev/github.com/alecthomas/chroma/v2/styles")
4141
flag.StringVar(&Config.Theme, "theme", "", "bulma theme to use. (light, dark). empty value means system preference is used")
4242
}

0 commit comments

Comments
 (0)