Anpassung auf dynamisches GIT
This commit is contained in:
@@ -41,6 +41,22 @@ var (
|
||||
|
||||
func main() {
|
||||
|
||||
// --- Verzeichnisse konfigurierbar machen -------------------------
|
||||
contentDir := os.Getenv("BLOG_CONTENT_DIR")
|
||||
if contentDir == "" {
|
||||
contentDir = "content" // Fallback für local run
|
||||
}
|
||||
|
||||
staticDir := os.Getenv("BLOG_STATIC_DIR")
|
||||
if staticDir == "" {
|
||||
staticDir = "internal/web/static"
|
||||
}
|
||||
|
||||
pagesDir := os.Getenv("BLOG_PAGES_DIR")
|
||||
if staticDir == "" {
|
||||
staticDir = "pages"
|
||||
}
|
||||
|
||||
funcs := template.FuncMap{
|
||||
"now": time.Now, // jetzt‑Zeit bereitstellen
|
||||
}
|
||||
@@ -64,14 +80,12 @@ func main() {
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
staticDir := "internal/web/static"
|
||||
|
||||
articles, err := article.LoadDir("content")
|
||||
articles, err := article.LoadDir(contentDir)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
staticPages, err := article.LoadStatic("pages")
|
||||
staticPages, err := article.LoadStatic(pagesDir)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user