Skip to content

Commit

Permalink
Move app name to ui.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikestefanello committed Feb 25, 2025
1 parent ab7be40 commit c6c1bdd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ type (

// AppConfig stores application configuration
AppConfig struct {
Name string
Environment environment
EncryptionKey string
Timeout time.Duration
Expand Down
1 change: 0 additions & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ http:
key: ""

app:
name: "Pagoda"
environment: "local"
# Change this on any live environments
encryptionKey: "?E(G+KbPeShVmYq3t6w9z$C&F)J@McQf"
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func head(r *request) Node {
Meta(Charset("utf-8")),
Meta(Name("viewport"), Content("width=device-width, initial-scale=1")),
Link(Rel("icon"), Href(file("favicon.png"))),
TitleEl(Text(r.Title)),
TitleEl(Text(appName), If(r.Title != "", Text(" | "+r.Title))),
If(r.Metatags.Description != "", Meta(Name("description"), Content(r.Metatags.Description))),
If(len(r.Metatags.Keywords) > 0, Meta(Name("keywords"), Content(strings.Join(r.Metatags.Keywords, ", ")))),
Link(Href("https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"), Rel("stylesheet")),
Expand Down
8 changes: 4 additions & 4 deletions pkg/ui/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (p *Posts) render(path string) Node {
g,
Div(
Class("field is-grouped is-grouped-centered"),
P(
If(!p.Pager.IsBeginning(), P(
Class("control"),
Button(
Class("button is-primary"),
Expand All @@ -50,8 +50,8 @@ func (p *Posts) render(path string) Node {
Attr("hx-target", "#posts"),
Text("Previous page"),
),
),
P(
)),
If(!p.Pager.IsEnd(), P(
Class("control"),
Button(
Class("button is-primary"),
Expand All @@ -60,7 +60,7 @@ func (p *Posts) render(path string) Node {
Attr("hx-target", "#posts"),
Text("Next page"),
),
),
)),
),
)
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/ui/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import (
"github.com/mikestefanello/pagoda/config"
)

const (
appName = "Pagoda"
)

var (
// CacheBuster stores a random string used as a cache buster for static files.
// cacheBuster stores a random string used as a cache buster for static files.
cacheBuster = random.String(10)
)

Expand Down

0 comments on commit c6c1bdd

Please sign in to comment.