summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-19 09:54:42 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-19 09:54:42 -1000
commita38abc90ee4fe00bf0fbdf897c5ef93e80e0c256 (patch)
tree0936c38580482f9de52e8b1e8c207e8d11f3457b /internal/config/config.go
parent2215aaa458b318edb16337ab56cf658117023eb4 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go2
1 files changed, 2 insertions, 0 deletions
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"),