diff --git a/less/core.less b/less/core.less index 80b2b22..8f6df46 100644 --- a/less/core.less +++ b/less/core.less @@ -17,7 +17,7 @@ body { -moz-osx-font-smoothing: grayscale; color: #111; - h1 { + h1, header h2 { a { color: @headerTextColor; .transition-duration(0.2s); @@ -1161,9 +1161,11 @@ header { text-transform: uppercase; margin-left: 0.5em; margin-right: 0.5em; - &.pro { - color: @proSelectedCol; - } + } + &.title { + font-size: 1.6em; + font-family: @serifFont; + font-weight: bold; } } nav > ul > li:first-child { @@ -1188,9 +1190,22 @@ header { } } &.tabs { + margin: 0 0 0 1em; + } + &+ nav.tabs { margin: 0; } } + &.singleuser { + margin: 0.5em 0.25em; + nav#user-nav { + nav > ul > li:first-child { + img { + top: -0.75em; + } + } + } + } .dash-nav { font-weight: bold; } diff --git a/less/new-core.less b/less/new-core.less index 7c46203..802f34d 100644 --- a/less/new-core.less +++ b/less/new-core.less @@ -39,7 +39,7 @@ body { header { margin: 1em; - h1 { + h1, h2 { display: inline; } nav { diff --git a/nodeinfo.go b/nodeinfo.go index b2c58fa..fd4b445 100644 --- a/nodeinfo.go +++ b/nodeinfo.go @@ -12,15 +12,23 @@ type nodeInfoResolver struct { db *datastore } -func nodeInfoConfig(cfg *config.Config) *nodeinfo.Config { +func nodeInfoConfig(db *datastore, cfg *config.Config) *nodeinfo.Config { name := cfg.App.SiteName + desc := "Minimal, federated blogging platform." + if cfg.App.SingleUser { + // Fetch blog information, instead + coll, err := db.GetCollectionByID(1) + if err == nil { + desc = coll.Description + } + } return &nodeinfo.Config{ BaseURL: cfg.App.Host, InfoURL: "/api/nodeinfo", Metadata: nodeinfo.Metadata{ NodeName: name, - NodeDescription: "Minimal, federated blogging platform.", + NodeDescription: desc, Private: cfg.App.Private, Software: nodeinfo.SoftwareMeta{ HomePage: softwareURL, diff --git a/pad.go b/pad.go index 6a04030..017b8e4 100644 --- a/pad.go +++ b/pad.go @@ -14,6 +14,14 @@ func handleViewPad(app *app, w http.ResponseWriter, r *http.Request) error { action := vars["action"] slug := vars["slug"] collAlias := vars["collection"] + if app.cfg.App.SingleUser { + // TODO: refactor all of this, especially for single-user blogs + c, err := app.db.GetCollectionByID(1) + if err != nil { + return err + } + collAlias = c.Alias + } appData := &struct { page.StaticPage Post *RawPost @@ -52,6 +60,7 @@ func handleViewPad(app *app, w http.ResponseWriter, r *http.Request) error { w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") w.Header().Set("Expires", "Thu, 04 Oct 1990 20:00:00 GMT") if slug != "" { + // TODO: refactor all of this, especially for single-user blogs appData.Post = getRawCollectionPost(app, slug, collAlias) if appData.Post.OwnerID != appData.User.ID { // TODO: add ErrForbiddenEditPost message to flashes diff --git a/pages/login.tmpl b/pages/login.tmpl index 411da50..9b58523 100644 --- a/pages/login.tmpl +++ b/pages/login.tmpl @@ -1,6 +1,6 @@ {{define "head"}}
{{if .Message}}{{.Message}}{{else}}No account yet? Sign up to start a blog.{{end}}
+ {{if and (not .SingleUser) .OpenRegistration}}{{if .Message}}{{.Message}}{{else}}No account yet? Sign up to start a blog.{{end}}
{{end}}