Documentation
¶
Index ¶
- func NewCompositeFSForTest(primary, secondary fs.FS) fs.FS
- func ResolveFSForTest(theme *Theme, embedded fs.FS, subPath string) fs.FS
- func StaticFiles(theme *Theme) http.Handler
- type AuthPageData
- type AuthorData
- type CommentItem
- type ContentData
- type FormattedField
- type IndexData
- type LanguageLink
- type LayoutData
- type NavigationItem
- type NotFoundData
- type PostItem
- type ResetPasswordData
- type TagData
- type Templates
- func (t *Templates) RenderAuthor(w http.ResponseWriter, data AuthorData) error
- func (t *Templates) RenderContent(w http.ResponseWriter, data ContentData) error
- func (t *Templates) RenderForgotPassword(w http.ResponseWriter, data AuthPageData) error
- func (t *Templates) RenderIndex(w http.ResponseWriter, data IndexData) error
- func (t *Templates) RenderLogin(w http.ResponseWriter, data AuthPageData) error
- func (t *Templates) RenderNotFound(w http.ResponseWriter, data NotFoundData) error
- func (t *Templates) RenderRegister(w http.ResponseWriter, data AuthPageData) error
- func (t *Templates) RenderResetPassword(w http.ResponseWriter, data ResetPasswordData) error
- func (t *Templates) RenderTag(w http.ResponseWriter, data TagData) error
- func (t *Templates) RenderVerifyEmail(w http.ResponseWriter, data VerifyEmailData) error
- type Theme
- type VerifyEmailData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompositeFSForTest ¶
NewCompositeFSForTest creates a compositeFS for testing purposes.
func ResolveFSForTest ¶
ResolveFSForTest exposes resolveFS for testing purposes.
func StaticFiles ¶
StaticFiles returns an http.Handler that serves the content site's static assets (CSS, JS). When a non-nil Theme with a non-empty Dir is provided, files on disk in that directory are served first, falling back to the embedded defaults for any file not present in the theme directory.
Types ¶
type AuthPageData ¶
type AuthPageData struct {
LayoutData
}
type AuthorData ¶
type AuthorData struct {
LayoutData
AuthorName string
Username string
AuthorAvatarURL string
Posts []PostItem
CustomFieldsFormatted []FormattedField
}
type CommentItem ¶
type ContentData ¶
type ContentData struct {
LayoutData
Slug string
Body template.HTML
Tags []string
Author string
Username string
AuthorAvatarURL string
CreatedAt string
AllowComments bool
CustomFields map[string]any
CustomFieldsFormatted []FormattedField
Comments []CommentItem
}
type FormattedField ¶
type IndexData ¶
type IndexData struct {
LayoutData
Posts []PostItem
Tags []string
}
type LanguageLink ¶
type LayoutData ¶
type NavigationItem ¶
type NavigationItem struct {
}
type NotFoundData ¶
type NotFoundData struct {
LayoutData
}
type ResetPasswordData ¶
type ResetPasswordData struct {
LayoutData
}
type TagData ¶
type TagData struct {
LayoutData
TagName string
Posts []PostItem
}
type Templates ¶
type Templates struct {
// contains filtered or unexported fields
}
func (*Templates) RenderAuthor ¶
func (t *Templates) RenderAuthor(w http.ResponseWriter, data AuthorData) error
func (*Templates) RenderContent ¶
func (t *Templates) RenderContent(w http.ResponseWriter, data ContentData) error
func (*Templates) RenderForgotPassword ¶
func (t *Templates) RenderForgotPassword(w http.ResponseWriter, data AuthPageData) error
func (*Templates) RenderIndex ¶
func (t *Templates) RenderIndex(w http.ResponseWriter, data IndexData) error
func (*Templates) RenderLogin ¶
func (t *Templates) RenderLogin(w http.ResponseWriter, data AuthPageData) error
func (*Templates) RenderNotFound ¶
func (t *Templates) RenderNotFound(w http.ResponseWriter, data NotFoundData) error
func (*Templates) RenderRegister ¶
func (t *Templates) RenderRegister(w http.ResponseWriter, data AuthPageData) error
func (*Templates) RenderResetPassword ¶
func (t *Templates) RenderResetPassword(w http.ResponseWriter, data ResetPasswordData) error
func (*Templates) RenderTag ¶
func (t *Templates) RenderTag(w http.ResponseWriter, data TagData) error
func (*Templates) RenderVerifyEmail ¶
func (t *Templates) RenderVerifyEmail(w http.ResponseWriter, data VerifyEmailData) error
type Theme ¶
type Theme struct {
Dir string
}
Theme holds the path to a custom theme directory on disk. When Dir is empty, embedded defaults are used.
type VerifyEmailData ¶
type VerifyEmailData struct {
LayoutData
}
Click to show internal directories.
Click to hide internal directories.