mirror of
https://github.com/btouchard/ackify.git
synced 2026-05-23 01:18:58 -05:00
feat: migrate templates to embedded filesystem
- Move templates from web/templates/ to webtemplates/templates/ - Replace file-based template loading with Go embed - Remove external template directory dependency from Dockerfile - Add webtemplates package with embedded template functionality - Include comprehensive tests for embedded templates - Update server initialization to use new embedded template system This change makes the application self-contained by embedding templates directly in the binary, eliminating the need for external template files at runtime.
This commit is contained in:
+2
-2
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/btouchard/ackify-ce/internal/infrastructure/config"
|
||||
"github.com/btouchard/ackify-ce/internal/infrastructure/database"
|
||||
"github.com/btouchard/ackify-ce/internal/presentation/handlers"
|
||||
"github.com/btouchard/ackify-ce/internal/presentation/templates"
|
||||
"github.com/btouchard/ackify-ce/pkg/crypto"
|
||||
"github.com/btouchard/ackify-ce/webtemplates"
|
||||
)
|
||||
|
||||
// Server represents the Ackify CE web server
|
||||
@@ -123,7 +123,7 @@ func initInfrastructure(ctx context.Context) (*config.Config, *sql.DB, *template
|
||||
}
|
||||
|
||||
// Initialize templates
|
||||
tmpl, err := templates.InitTemplates()
|
||||
tmpl, err := webtemplates.InitTemplates()
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, fmt.Errorf("failed to initialize templates: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user