fix: Resolve CSS bundling in production and lint errors
- Fix golangci-lint errcheck errors by using t.Setenv() instead of os.Setenv() - Add CSS bundle build step to deploy workflow for production - Add graceful fallback to modular CSS if bundle doesn't exist - Remove unused os import from preferences_test.go
This commit is contained in:
@@ -330,8 +330,16 @@ func (h *CVHandler) prepareTemplateData(lang string) (map[string]interface{}, er
|
||||
// Get current year
|
||||
currentYear := time.Now().Year()
|
||||
|
||||
// Check if production mode
|
||||
// Check if production mode AND CSS bundle exists
|
||||
// This ensures graceful fallback to modular CSS if bundle not built
|
||||
isProduction := os.Getenv("GO_ENV") == "production"
|
||||
if isProduction {
|
||||
bundlePath := filepath.Join("static", "dist", "bundle.min.css")
|
||||
if _, err := os.Stat(bundlePath); os.IsNotExist(err) {
|
||||
// Bundle doesn't exist, fall back to modular CSS
|
||||
isProduction = false
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare template data
|
||||
data := map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user