Shuffle around packages, fix rophako-import
This commit is contained in:
parent
f702ad12e0
commit
7fa422e42f
|
@ -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"
|
||||
)
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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.
|
|
@ -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) {
|
|
@ -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.
|
|
@ -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)
|
|
@ -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) {
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -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) {
|
|
@ -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.
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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.
|
|
@ -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.
|
|
@ -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"
|
||||
)
|
|
@ -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"
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/kirsle/blog/core/internal/log"
|
||||
"github.com/kirsle/blog/internal/log"
|
||||
)
|
||||
|
||||
// Blog configuration bindings.
|
|
@ -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
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -2,10 +2,6 @@
|
|||
* Globals
|
||||
*/
|
||||
|
||||
* {
|
||||
transition-duration: 0.5s;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Verdana, Helvetica, Arial, sans-serif;
|
||||
color: #555;
|
||||
|
|
Loading…
Reference in New Issue
Block a user