From bfb5a61e14d286bc71399291bb5c03267693574a Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Thu, 23 Dec 2021 18:56:27 +0100 Subject: [PATCH] =?UTF-8?q?Niente=20pi=C3=B9=20blog=20in=20quanto=20ora=20?= =?UTF-8?q?c'=C3=A8=20la=20sezione=20News?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 -- articles.go | 2 +- main.go | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b7f18a5..9736c00 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ Per clonare il progetto usare $ git clone https://github.com/phc-dm/phc-server ``` - - ## Development Copiare il file `.env.dev` in `.env` per dire al server di lavorare in modalità di development e su quale indirizzo servire il sito, poi avviare il server. diff --git a/articles.go b/articles.go index ad6cace..49ada2b 100644 --- a/articles.go +++ b/articles.go @@ -197,7 +197,7 @@ func (registry *ArticleRenderer) LoadAll() ([]*Article, error) { return articles, nil } -func NewArticleRegistry(rootPath string) *ArticleRenderer { +func NewArticleRenderer(rootPath string) *ArticleRenderer { return &ArticleRenderer{ rootPath, } diff --git a/main.go b/main.go index 02ac8d4..d2a8126 100644 --- a/main.go +++ b/main.go @@ -23,11 +23,10 @@ func main() { // Static content r.Handle("/public/*", http.StripPrefix("/public", http.FileServer(http.Dir("./public")))) - r.Handle("/blog/*", http.StripPrefix("/blog", http.FileServer(http.Dir("./blog/public")))) // Templates & Renderer renderer := NewTemplateRenderer("base.html") - newsArticlesRegistry := NewArticleRegistry("./news") + newsArticlesRegistry := NewArticleRenderer("./news") // Routes r.Get("/", func(w http.ResponseWriter, r *http.Request) {