增加页面优化相关API、配置、消息代号

This commit is contained in:
刘祥超
2023-07-11 19:47:05 +08:00
parent fd4aff5ab5
commit a9b28d55c1
17 changed files with 1252 additions and 856 deletions

View File

@@ -0,0 +1,29 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
package serverconfigs
import "github.com/tdewolff/minify/v2/css"
type HTTPCSSOptimizationConfig struct {
IsOn bool `yaml:"isOn" json:"isOn"`
Precision int `yaml:"precision" json:"precision"`
KeepCSS2 bool `yaml:"keepCSS2" json:"keepCSS2"`
}
func NewHTTPCSSOptimizationConfig() *HTTPCSSOptimizationConfig {
return &HTTPCSSOptimizationConfig{
KeepCSS2: true,
}
}
func (this *HTTPCSSOptimizationConfig) Init() error {
return nil
}
func (this *HTTPCSSOptimizationConfig) AsMinifier() *css.Minifier {
return &css.Minifier{
KeepCSS2: this.KeepCSS2,
Precision: this.Precision,
}
}