From 7fa422e42f3ee5c5a0d3edab2031133aef07ec27 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 11 Feb 2018 16:24:43 -0800 Subject: [PATCH] Shuffle around packages, fix rophako-import --- core/core.go => blog.go | 38 +++++++++---------- cmd/blog/main.go | 4 +- cmd/rophako-import/main.go | 4 +- core/errors.go => errors.go | 8 ++-- .../controllers/admin/admin.go | 4 +- .../controllers/admin/editor.go | 4 +- .../controllers/admin/settings.go | 8 ++-- .../controllers/authctl/authctl.go | 14 +++---- .../controllers/comments/comments.go | 18 ++++----- .../controllers/comments/subscriptions.go | 6 +-- .../controllers/contact/contact.go | 12 +++--- .../controllers/posts/archive.go | 10 ++--- .../controllers/posts/edit.go | 12 +++--- .../controllers/posts/feeds.go | 8 ++-- .../controllers/posts/index.go | 12 +++--- .../controllers/posts/posts.go | 16 ++++---- .../controllers/posts/tagged.go | 4 +- .../controllers/setup/setup.go | 16 ++++---- {core/internal => internal}/forms/auth.go | 0 {core/internal => internal}/forms/contact.go | 0 {core/internal => internal}/forms/forms.go | 0 {core/internal => internal}/forms/settings.go | 0 {core/internal => internal}/forms/setup.go | 0 {core/internal => internal}/log/log.go | 0 {core/internal => internal}/mail/mail.go | 10 ++--- .../markdown/markdown.go | 2 +- .../middleware/auth/auth.go | 6 +-- .../internal => internal}/middleware/csrf.go | 4 +- .../internal => internal}/render/functions.go | 0 .../render/resolve_paths.go | 2 +- .../internal => internal}/render/templates.go | 14 +++---- .../responses/responses.go | 2 +- .../sessions/sessions.go | 4 +- .../internal => internal}/types/constants.go | 0 {core/internal => internal}/types/context.go | 0 .../models => models}/comments/comments.go | 0 .../models => models}/comments/subscribers.go | 0 .../internal/models => models}/posts/index.go | 0 .../internal/models => models}/posts/posts.go | 0 .../models => models}/posts/sorting.go | 0 .../models => models}/settings/settings.go | 0 .../internal/models => models}/users/users.go | 0 .../internal/models => models}/users/utils.go | 0 core/pages.go => pages.go | 12 +++--- root/bluez/theme.css | 4 -- 45 files changed, 127 insertions(+), 131 deletions(-) rename core/core.go => blog.go (77%) rename core/errors.go => errors.go (91%) rename {core/internal => internal}/controllers/admin/admin.go (86%) rename {core/internal => internal}/controllers/admin/editor.go (97%) rename {core/internal => internal}/controllers/admin/settings.go (91%) rename {core/internal => internal}/controllers/authctl/authctl.go (91%) rename {core/internal => internal}/controllers/comments/comments.go (94%) rename {core/internal => internal}/controllers/comments/subscriptions.go (87%) rename {core/internal => internal}/controllers/contact/contact.go (87%) rename {core/internal => internal}/controllers/posts/archive.go (84%) rename {core/internal => internal}/controllers/posts/edit.go (87%) rename {core/internal => internal}/controllers/posts/feeds.go (86%) rename {core/internal => internal}/controllers/posts/index.go (90%) rename {core/internal => internal}/controllers/posts/posts.go (92%) rename {core/internal => internal}/controllers/posts/tagged.go (90%) rename {core/internal => internal}/controllers/setup/setup.go (77%) rename {core/internal => internal}/forms/auth.go (100%) rename {core/internal => internal}/forms/contact.go (100%) rename {core/internal => internal}/forms/forms.go (100%) rename {core/internal => internal}/forms/settings.go (100%) rename {core/internal => internal}/forms/setup.go (100%) rename {core/internal => internal}/log/log.go (100%) rename {core/internal => internal}/mail/mail.go (93%) rename {core/internal => internal}/markdown/markdown.go (99%) rename {core/internal => internal}/middleware/auth/auth.go (92%) rename {core/internal => internal}/middleware/csrf.go (94%) rename {core/internal => internal}/render/functions.go (100%) rename {core/internal => internal}/render/resolve_paths.go (98%) rename {core/internal => internal}/render/templates.go (91%) rename {core/internal => internal}/responses/responses.go (96%) rename {core/internal => internal}/sessions/sessions.go (94%) rename {core/internal => internal}/types/constants.go (100%) rename {core/internal => internal}/types/context.go (100%) rename {core/internal/models => models}/comments/comments.go (100%) rename {core/internal/models => models}/comments/subscribers.go (100%) rename {core/internal/models => models}/posts/index.go (100%) rename {core/internal/models => models}/posts/posts.go (100%) rename {core/internal/models => models}/posts/sorting.go (100%) rename {core/internal/models => models}/settings/settings.go (100%) rename {core/internal/models => models}/users/users.go (100%) rename {core/internal/models => models}/users/utils.go (100%) rename core/pages.go => pages.go (87%) diff --git a/core/core.go b/blog.go similarity index 77% rename from core/core.go rename to blog.go index 5081fac..5ac4146 100644 --- a/core/core.go +++ b/blog.go @@ -1,5 +1,5 @@ -// Package core implements the core source code of kirsle/blog. -package core +// Package blog is a personal website and blogging app. +package blog import ( "fmt" @@ -7,27 +7,27 @@ import ( "path/filepath" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/controllers/admin" - "github.com/kirsle/blog/core/internal/controllers/authctl" - commentctl "github.com/kirsle/blog/core/internal/controllers/comments" - "github.com/kirsle/blog/core/internal/controllers/contact" - postctl "github.com/kirsle/blog/core/internal/controllers/posts" - "github.com/kirsle/blog/core/internal/controllers/setup" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/middleware" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/comments" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/sessions" + "github.com/kirsle/blog/internal/controllers/admin" + "github.com/kirsle/blog/internal/controllers/authctl" + commentctl "github.com/kirsle/blog/internal/controllers/comments" + "github.com/kirsle/blog/internal/controllers/contact" + postctl "github.com/kirsle/blog/internal/controllers/posts" + "github.com/kirsle/blog/internal/controllers/setup" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/internal/middleware" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/sessions" "github.com/kirsle/blog/jsondb" "github.com/kirsle/blog/jsondb/caches" "github.com/kirsle/blog/jsondb/caches/null" "github.com/kirsle/blog/jsondb/caches/redis" + "github.com/kirsle/blog/models/comments" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/models/users" "github.com/shurcooL/github_flavored_markdown/gfmstyle" "github.com/urfave/negroni" ) diff --git a/cmd/blog/main.go b/cmd/blog/main.go index f4de630..69e89ef 100644 --- a/cmd/blog/main.go +++ b/cmd/blog/main.go @@ -9,7 +9,7 @@ import ( "fmt" "os" - "github.com/kirsle/blog/core" + "github.com/kirsle/blog" "github.com/kirsle/blog/jsondb" ) @@ -41,7 +41,7 @@ func main() { os.Exit(1) } - app := core.New(DocumentRoot, userRoot) + app := blog.New(DocumentRoot, userRoot) if fDebug { app.Debug = true } diff --git a/cmd/rophako-import/main.go b/cmd/rophako-import/main.go index 650832e..3d8f265 100644 --- a/cmd/rophako-import/main.go +++ b/cmd/rophako-import/main.go @@ -17,8 +17,8 @@ import ( "github.com/google/uuid" "github.com/kirsle/blog/jsondb" - "github.com/kirsle/blog/core/models/comments" - "github.com/kirsle/blog/core/models/posts" + "github.com/kirsle/blog/models/comments" + "github.com/kirsle/blog/models/posts" "github.com/kirsle/golog" ) diff --git a/core/errors.go b/errors.go similarity index 91% rename from core/errors.go rename to errors.go index 52175cf..36fb631 100644 --- a/core/errors.go +++ b/errors.go @@ -1,11 +1,11 @@ -package core +package blog import ( "net/http" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" ) // registerErrors loads the error handlers into the responses subpackage. diff --git a/core/internal/controllers/admin/admin.go b/internal/controllers/admin/admin.go similarity index 86% rename from core/internal/controllers/admin/admin.go rename to internal/controllers/admin/admin.go index 1ade73c..92783f4 100644 --- a/core/internal/controllers/admin/admin.go +++ b/internal/controllers/admin/admin.go @@ -4,8 +4,8 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/render" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/internal/render" "github.com/urfave/negroni" ) diff --git a/core/internal/controllers/admin/editor.go b/internal/controllers/admin/editor.go similarity index 97% rename from core/internal/controllers/admin/editor.go rename to internal/controllers/admin/editor.go index 448bde2..d531d28 100644 --- a/core/internal/controllers/admin/editor.go +++ b/internal/controllers/admin/editor.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" ) // FileTree holds information about files in the document roots. diff --git a/core/internal/controllers/admin/settings.go b/internal/controllers/admin/settings.go similarity index 91% rename from core/internal/controllers/admin/settings.go rename to internal/controllers/admin/settings.go index be66074..17e78f6 100644 --- a/core/internal/controllers/admin/settings.go +++ b/internal/controllers/admin/settings.go @@ -4,10 +4,10 @@ import ( "net/http" "strconv" - "github.com/kirsle/blog/core/internal/forms" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/internal/forms" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" ) func settingsHandler(w http.ResponseWriter, r *http.Request) { diff --git a/core/internal/controllers/authctl/authctl.go b/internal/controllers/authctl/authctl.go similarity index 91% rename from core/internal/controllers/authctl/authctl.go rename to internal/controllers/authctl/authctl.go index 42da874..e9043c6 100644 --- a/core/internal/controllers/authctl/authctl.go +++ b/internal/controllers/authctl/authctl.go @@ -5,13 +5,13 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/forms" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/sessions" + "github.com/kirsle/blog/internal/forms" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/sessions" ) // Register the initial setup routes. diff --git a/core/internal/controllers/comments/comments.go b/internal/controllers/comments/comments.go similarity index 94% rename from core/internal/controllers/comments/comments.go rename to internal/controllers/comments/comments.go index 8ee594a..7cd2d18 100644 --- a/core/internal/controllers/comments/comments.go +++ b/internal/controllers/comments/comments.go @@ -8,15 +8,15 @@ import ( "github.com/google/uuid" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/mail" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/comments" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/sessions" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/mail" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/comments" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/sessions" ) var badRequest func(http.ResponseWriter, *http.Request, string) diff --git a/core/internal/controllers/comments/subscriptions.go b/internal/controllers/comments/subscriptions.go similarity index 87% rename from core/internal/controllers/comments/subscriptions.go rename to internal/controllers/comments/subscriptions.go index 58e217c..d2b100a 100644 --- a/core/internal/controllers/comments/subscriptions.go +++ b/internal/controllers/comments/subscriptions.go @@ -4,9 +4,9 @@ import ( "net/http" "net/mail" - "github.com/kirsle/blog/core/internal/models/comments" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/models/comments" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" ) func subscriptionHandler(w http.ResponseWriter, r *http.Request) { diff --git a/core/internal/controllers/contact/contact.go b/internal/controllers/contact/contact.go similarity index 87% rename from core/internal/controllers/contact/contact.go rename to internal/controllers/contact/contact.go index 7d3a444..12aedf8 100644 --- a/core/internal/controllers/contact/contact.go +++ b/internal/controllers/contact/contact.go @@ -9,12 +9,12 @@ import ( "time" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/forms" - "github.com/kirsle/blog/core/internal/mail" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/internal/forms" + "github.com/kirsle/blog/internal/mail" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" ) // Register attaches the contact URL to the app. diff --git a/core/internal/controllers/posts/archive.go b/internal/controllers/posts/archive.go similarity index 84% rename from core/internal/controllers/posts/archive.go rename to internal/controllers/posts/archive.go index 4362723..875cb0c 100644 --- a/core/internal/controllers/posts/archive.go +++ b/internal/controllers/posts/archive.go @@ -5,11 +5,11 @@ import ( "sort" "time" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/types" ) // archiveHandler summarizes all blog entries in an archive view. diff --git a/core/internal/controllers/posts/edit.go b/internal/controllers/posts/edit.go similarity index 87% rename from core/internal/controllers/posts/edit.go rename to internal/controllers/posts/edit.go index 8ca1b1f..49e264c 100644 --- a/core/internal/controllers/posts/edit.go +++ b/internal/controllers/posts/edit.go @@ -7,12 +7,12 @@ import ( "strconv" "time" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/types" ) // editHandler is the blog writing and editing page. diff --git a/core/internal/controllers/posts/feeds.go b/internal/controllers/posts/feeds.go similarity index 86% rename from core/internal/controllers/posts/feeds.go rename to internal/controllers/posts/feeds.go index 1c9990c..093528e 100644 --- a/core/internal/controllers/posts/feeds.go +++ b/internal/controllers/posts/feeds.go @@ -6,10 +6,10 @@ import ( "time" "github.com/gorilla/feeds" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/responses" ) func feedHandler(w http.ResponseWriter, r *http.Request) { diff --git a/core/internal/controllers/posts/index.go b/internal/controllers/posts/index.go similarity index 90% rename from core/internal/controllers/posts/index.go rename to internal/controllers/posts/index.go index 2c0bc64..5b79547 100644 --- a/core/internal/controllers/posts/index.go +++ b/internal/controllers/posts/index.go @@ -7,12 +7,12 @@ import ( "net/http" "strconv" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/models/comments" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/models/comments" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/types" ) // partialIndex renders and returns the blog index partial. diff --git a/core/internal/controllers/posts/posts.go b/internal/controllers/posts/posts.go similarity index 92% rename from core/internal/controllers/posts/posts.go rename to internal/controllers/posts/posts.go index 5fd0106..db9846f 100644 --- a/core/internal/controllers/posts/posts.go +++ b/internal/controllers/posts/posts.go @@ -10,14 +10,14 @@ import ( "time" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/types" "github.com/urfave/negroni" ) diff --git a/core/internal/controllers/posts/tagged.go b/internal/controllers/posts/tagged.go similarity index 90% rename from core/internal/controllers/posts/tagged.go rename to internal/controllers/posts/tagged.go index 25d5240..72e6bc5 100644 --- a/core/internal/controllers/posts/tagged.go +++ b/internal/controllers/posts/tagged.go @@ -6,8 +6,8 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/models/posts" - "github.com/kirsle/blog/core/internal/render" + "github.com/kirsle/blog/models/posts" + "github.com/kirsle/blog/internal/render" ) // tagged lets you browse blog posts by category. diff --git a/core/internal/controllers/setup/setup.go b/internal/controllers/setup/setup.go similarity index 77% rename from core/internal/controllers/setup/setup.go rename to internal/controllers/setup/setup.go index 2e0a093..07a65f7 100644 --- a/core/internal/controllers/setup/setup.go +++ b/internal/controllers/setup/setup.go @@ -4,14 +4,14 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/kirsle/blog/core/internal/forms" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" - "github.com/kirsle/blog/core/internal/sessions" + "github.com/kirsle/blog/internal/forms" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" + "github.com/kirsle/blog/internal/sessions" ) // Register the initial setup routes. diff --git a/core/internal/forms/auth.go b/internal/forms/auth.go similarity index 100% rename from core/internal/forms/auth.go rename to internal/forms/auth.go diff --git a/core/internal/forms/contact.go b/internal/forms/contact.go similarity index 100% rename from core/internal/forms/contact.go rename to internal/forms/contact.go diff --git a/core/internal/forms/forms.go b/internal/forms/forms.go similarity index 100% rename from core/internal/forms/forms.go rename to internal/forms/forms.go diff --git a/core/internal/forms/settings.go b/internal/forms/settings.go similarity index 100% rename from core/internal/forms/settings.go rename to internal/forms/settings.go diff --git a/core/internal/forms/setup.go b/internal/forms/setup.go similarity index 100% rename from core/internal/forms/setup.go rename to internal/forms/setup.go diff --git a/core/internal/log/log.go b/internal/log/log.go similarity index 100% rename from core/internal/log/log.go rename to internal/log/log.go diff --git a/core/internal/mail/mail.go b/internal/mail/mail.go similarity index 93% rename from core/internal/mail/mail.go rename to internal/mail/mail.go index d5090b9..13ba54f 100644 --- a/core/internal/mail/mail.go +++ b/internal/mail/mail.go @@ -8,11 +8,11 @@ import ( "net/url" "strings" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/models/comments" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/render" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/models/comments" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/internal/render" "github.com/microcosm-cc/bluemonday" gomail "gopkg.in/gomail.v2" ) diff --git a/core/internal/markdown/markdown.go b/internal/markdown/markdown.go similarity index 99% rename from core/internal/markdown/markdown.go rename to internal/markdown/markdown.go index 6bb1b47..6b6fc4d 100644 --- a/core/internal/markdown/markdown.go +++ b/internal/markdown/markdown.go @@ -11,7 +11,7 @@ import ( "regexp" "strings" - "github.com/kirsle/blog/core/internal/log" + "github.com/kirsle/blog/internal/log" "github.com/kirsle/blog/jsondb/caches" "github.com/microcosm-cc/bluemonday" "github.com/shurcooL/github_flavored_markdown" diff --git a/core/internal/middleware/auth/auth.go b/internal/middleware/auth/auth.go similarity index 92% rename from core/internal/middleware/auth/auth.go rename to internal/middleware/auth/auth.go index 74b410d..ff496c1 100644 --- a/core/internal/middleware/auth/auth.go +++ b/internal/middleware/auth/auth.go @@ -5,9 +5,9 @@ import ( "errors" "net/http" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/sessions" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/internal/types" "github.com/urfave/negroni" ) diff --git a/core/internal/middleware/csrf.go b/internal/middleware/csrf.go similarity index 94% rename from core/internal/middleware/csrf.go rename to internal/middleware/csrf.go index 37d68b3..9107624 100644 --- a/core/internal/middleware/csrf.go +++ b/internal/middleware/csrf.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" gorilla "github.com/gorilla/sessions" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/sessions" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/sessions" "github.com/urfave/negroni" ) diff --git a/core/internal/render/functions.go b/internal/render/functions.go similarity index 100% rename from core/internal/render/functions.go rename to internal/render/functions.go diff --git a/core/internal/render/resolve_paths.go b/internal/render/resolve_paths.go similarity index 98% rename from core/internal/render/resolve_paths.go rename to internal/render/resolve_paths.go index 6f3b280..1728efd 100644 --- a/core/internal/render/resolve_paths.go +++ b/internal/render/resolve_paths.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/kirsle/blog/core/internal/log" + "github.com/kirsle/blog/internal/log" ) // Blog configuration bindings. diff --git a/core/internal/render/templates.go b/internal/render/templates.go similarity index 91% rename from core/internal/render/templates.go rename to internal/render/templates.go index 0b7affe..12de0a4 100644 --- a/core/internal/render/templates.go +++ b/internal/render/templates.go @@ -7,13 +7,13 @@ import ( "strings" "time" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/middleware" - "github.com/kirsle/blog/core/internal/middleware/auth" - "github.com/kirsle/blog/core/internal/models/settings" - "github.com/kirsle/blog/core/internal/models/users" - "github.com/kirsle/blog/core/internal/sessions" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/middleware" + "github.com/kirsle/blog/internal/middleware/auth" + "github.com/kirsle/blog/models/settings" + "github.com/kirsle/blog/models/users" + "github.com/kirsle/blog/internal/sessions" + "github.com/kirsle/blog/internal/types" ) // Vars is an interface to implement by the templates to pass their own custom diff --git a/core/internal/responses/responses.go b/internal/responses/responses.go similarity index 96% rename from core/internal/responses/responses.go rename to internal/responses/responses.go index cef2963..3770c41 100644 --- a/core/internal/responses/responses.go +++ b/internal/responses/responses.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/kirsle/blog/core/internal/sessions" + "github.com/kirsle/blog/internal/sessions" ) // Error handlers to be filled in by the blog app. diff --git a/core/internal/sessions/sessions.go b/internal/sessions/sessions.go similarity index 94% rename from core/internal/sessions/sessions.go rename to internal/sessions/sessions.go index 3c9ec3e..6bd0ef2 100644 --- a/core/internal/sessions/sessions.go +++ b/internal/sessions/sessions.go @@ -6,8 +6,8 @@ import ( "time" "github.com/gorilla/sessions" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/types" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/types" ) // Store holds your cookie store information. diff --git a/core/internal/types/constants.go b/internal/types/constants.go similarity index 100% rename from core/internal/types/constants.go rename to internal/types/constants.go diff --git a/core/internal/types/context.go b/internal/types/context.go similarity index 100% rename from core/internal/types/context.go rename to internal/types/context.go diff --git a/core/internal/models/comments/comments.go b/models/comments/comments.go similarity index 100% rename from core/internal/models/comments/comments.go rename to models/comments/comments.go diff --git a/core/internal/models/comments/subscribers.go b/models/comments/subscribers.go similarity index 100% rename from core/internal/models/comments/subscribers.go rename to models/comments/subscribers.go diff --git a/core/internal/models/posts/index.go b/models/posts/index.go similarity index 100% rename from core/internal/models/posts/index.go rename to models/posts/index.go diff --git a/core/internal/models/posts/posts.go b/models/posts/posts.go similarity index 100% rename from core/internal/models/posts/posts.go rename to models/posts/posts.go diff --git a/core/internal/models/posts/sorting.go b/models/posts/sorting.go similarity index 100% rename from core/internal/models/posts/sorting.go rename to models/posts/sorting.go diff --git a/core/internal/models/settings/settings.go b/models/settings/settings.go similarity index 100% rename from core/internal/models/settings/settings.go rename to models/settings/settings.go diff --git a/core/internal/models/users/users.go b/models/users/users.go similarity index 100% rename from core/internal/models/users/users.go rename to models/users/users.go diff --git a/core/internal/models/users/utils.go b/models/users/utils.go similarity index 100% rename from core/internal/models/users/utils.go rename to models/users/utils.go diff --git a/core/pages.go b/pages.go similarity index 87% rename from core/pages.go rename to pages.go index 6b6a068..f168727 100644 --- a/core/pages.go +++ b/pages.go @@ -1,4 +1,4 @@ -package core +package blog import ( "html/template" @@ -6,11 +6,11 @@ import ( "net/http" "strings" - "github.com/kirsle/blog/core/internal/controllers/posts" - "github.com/kirsle/blog/core/internal/log" - "github.com/kirsle/blog/core/internal/markdown" - "github.com/kirsle/blog/core/internal/render" - "github.com/kirsle/blog/core/internal/responses" + "github.com/kirsle/blog/internal/controllers/posts" + "github.com/kirsle/blog/internal/log" + "github.com/kirsle/blog/internal/markdown" + "github.com/kirsle/blog/internal/render" + "github.com/kirsle/blog/internal/responses" ) // PageHandler is the catch-all route handler, for serving static web pages. diff --git a/root/bluez/theme.css b/root/bluez/theme.css index 3660175..940d476 100644 --- a/root/bluez/theme.css +++ b/root/bluez/theme.css @@ -2,10 +2,6 @@ * Globals */ -* { - transition-duration: 0.5s; -} - body { font-family: Verdana, Helvetica, Arial, sans-serif; color: #555;