From 545540258ba5eff9f262be9715a53451b5b6f99d Mon Sep 17 00:00:00 2001 From: josing Date: Sat, 3 Jul 2021 09:48:41 +0800 Subject: [PATCH] Support preview of file with the suffix .conf --- previewer/code.go | 3 ++- previewer/previewer.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/previewer/code.go b/previewer/code.go index c32ce7b..0b0096e 100644 --- a/previewer/code.go +++ b/previewer/code.go @@ -35,7 +35,8 @@ var ExtJSMap = map[string]template.HTML{ ".xml": "xml", ".coffee": "coffee", ".sh": "sh", - ".log": "log", + ".log": "log", + ".conf": "conf", } func (i *Code) Preview(content []byte) template.HTML { diff --git a/previewer/previewer.go b/previewer/previewer.go index fe23f6e..8f0a986 100644 --- a/previewer/previewer.go +++ b/previewer/previewer.go @@ -44,7 +44,7 @@ var image = new(Image) var codeExtensions = [...]string{ ".go", ".php", ".html", ".css", ".js", ".py", ".md", ".c", ".cpp", ".java", ".sh", ".tmpl", ".mod", ".sum", - ".sql", ".json", ".txt", ".yml", "yaml", ".log", + ".sql", ".json", ".txt", ".yml", "yaml", ".log", ".conf", } func IsCode(ext string) bool {