diff options
Diffstat (limited to 'internal/web/theme.go')
| -rw-r--r-- | internal/web/theme.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/web/theme.go b/internal/web/theme.go index acfe158..70b218e 100644 --- a/internal/web/theme.go +++ b/internal/web/theme.go @@ -45,6 +45,8 @@ type Theme struct { ShowDates bool `json:"show_dates"` DateFormat string `json:"date_format"` // long | short | iso (rendered by i18n.FormatDate) PostsPerPage int `json:"posts_per_page"` // on listings and tag pages; one of postsPerPageChoices + ListStyle string `json:"list_style"` // full | summary (see summary.go) + PostImage string `json:"post_image"` // where the post page shows the featured image: top | bottom | list (listings only) FooterBg string `json:"footer_bg"` FooterColor string `json:"footer_color"` @@ -87,7 +89,7 @@ func DefaultTheme() Theme { Font: "sans", HeadingFont: "same", FontSize: "normal", HeaderImageHeight: "medium", HeaderAlign: "left", HeaderBg: "#2f3a4a", HeaderText: "#ffffff", TitleSize: "normal", NavAlign: "left", NavStyle: "normal", NavBg: "#ffffff", NavText: "#222222", - ShowDates: true, DateFormat: "long", PostsPerPage: postsPerPageChoices[0], + ShowDates: true, DateFormat: "long", PostsPerPage: postsPerPageChoices[0], ListStyle: "full", PostImage: "top", FooterBg: "#2f3a4a", FooterColor: "#d0d5dc", FooterAlign: "center", LogoSize: "medium", HeaderOn: true, LeftOn: true, RightOn: true, FooterOn: true, LeftWidth: 25, RightWidth: 25, @@ -171,6 +173,8 @@ func (t *Theme) normalize() { t.NavHover = optColor(t.NavHover) t.DateFormat = pick(t.DateFormat, "long", "short", "iso") t.PostsPerPage = pickInt(t.PostsPerPage, postsPerPageChoices...) + t.ListStyle = pick(t.ListStyle, "full", "summary") + t.PostImage = pick(t.PostImage, "top", "bottom", "list") t.FooterBg = color(t.FooterBg, d.FooterBg) t.FooterColor = color(t.FooterColor, d.FooterColor) t.FooterAlign = pick(t.FooterAlign, "center", "left") @@ -233,6 +237,8 @@ func ThemeFromForm(cur Theme, f url.Values) Theme { t.ShowDates = on("show_dates") t.DateFormat = get("date_format") t.PostsPerPage = num("posts_per_page") + t.ListStyle = get("list_style") + t.PostImage = get("post_image") t.FooterBg = get("footer_bg") t.FooterColor = get("footer_color") t.FooterAlign = get("footer_align") |
