From a38abc90ee4fe00bf0fbdf897c5ef93e80e0c256 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 19 Jan 2026 09:54:42 -1000 Subject: Refactor: Add cache key constants and configurable template path Code quality improvements: - Define CacheKey* constants in store package for type safety - Add TemplateDir to config (default: web/templates, env: TEMPLATE_DIR) - Update handlers to use store.CacheKey* instead of hardcoded strings - Update NewTabsHandler to accept templateDir parameter - Use filepath.Join for cross-platform template path construction Co-Authored-By: Claude Opus 4.5 --- internal/config/config.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/config/config.go') diff --git a/internal/config/config.go b/internal/config/config.go index dc7d1c3..93f57cc 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -17,6 +17,7 @@ type Config struct { // Paths ObsidianVaultPath string DatabasePath string + TemplateDir string // Server Port string @@ -36,6 +37,7 @@ func Load() (*Config, error) { // Paths ObsidianVaultPath: os.Getenv("OBSIDIAN_VAULT_PATH"), DatabasePath: getEnvWithDefault("DATABASE_PATH", "./dashboard.db"), + TemplateDir: getEnvWithDefault("TEMPLATE_DIR", "web/templates"), // Server Port: getEnvWithDefault("PORT", "8080"), -- cgit v1.2.3