Versions in this module Expand all Collapse all v0 v0.1.1 Mar 4, 2026 Changes in this version + var EmbeddedAssets embed.FS + var ErrNotFound = sql.ErrNoRows + func BlogPostingJsonLD(post BlogPost, cfg SiteConfig) string + func BuildURL(base string, pathSegments ...string) string + func CsrfToken(c echo.Context) string + func EnvOr(key, fallback string) string + func FilterEmpty(vals []string) []string + func IsAdmin(c echo.Context) bool + func JoinTags(tags []string) string + func MustEnv(key string) string + func ParseTags(tagString string) []string + func PathEscape(s string) string + func Render(c echo.Context, cmp templ.Component) error + func RenderStatus(c echo.Context, code int, cmp templ.Component) error + func Slugify(s string) string + func ValidateSlug(slug string) string + func WebsiteJsonLD(cfg SiteConfig) string + type App struct + Cache *PostCache + Config SiteConfig + Echo *echo.Echo + Store *Store + Views ViewFuncs + func New(cfg SiteConfig, views ViewFuncs, opts ...Option) *App + func (a *App) Close() error + func (a *App) Start() error + type BlogPost struct + Content string + Date string + Link string + Published bool + Slug string + Summary string + Tags []string + Title string + func FilterRelatedPosts(current BlogPost, posts []BlogPost) []BlogPost + type Image struct + Filename string + Height int + OriginalName string + Size int + UploadedAt string + Width int + type LoginLimiter struct + func NewLoginLimiter(max int, window time.Duration) *LoginLimiter + func (l *LoginLimiter) Allow(ip string) bool + func (l *LoginLimiter) Check(ip string) bool + func (l *LoginLimiter) Record(ip string) + type Option func(*App) + func WithCustomRoutes(fn func(*App)) Option + func WithStaticDir(dir string) Option + type PageMeta struct + Description string + OGType string + Title string + URL string + type PostCache struct + func NewPostCache(s *Store, ttl time.Duration) *PostCache + func (c *PostCache) GetPost(slug string) (BlogPost, error) + func (c *PostCache) Invalidate() + func (c *PostCache) ListPosts(tag string) ([]BlogPost, error) + func (c *PostCache) ListTags() ([]string, error) + type SiteConfig struct + Addr string + AdminPassword string + AnalyticsDatabasePath string + AnalyticsEnabled bool + Author string + CookieSecure bool + DatabasePath string + Description string + GoogleAdminEmail string + GoogleClientID string + GoogleClientSecret string + Name string + PostCacheTTL time.Duration + SessionSecret string + URL string + func (c *SiteConfig) GoogleAuthEnabled() bool + type Store struct + func NewStore(path string) (*Store, error) + func (s *Store) Close() error + func (s *Store) DeleteImage(filename string) error + func (s *Store) DeletePost(slug string) error + func (s *Store) GetPost(slug string) (BlogPost, error) + func (s *Store) GetPostAny(slug string) (BlogPost, error) + func (s *Store) ListAllPosts() ([]BlogPost, error) + func (s *Store) ListImages() ([]Image, error) + func (s *Store) ListPosts(tag string) ([]BlogPost, error) + func (s *Store) ListTags() ([]string, error) + func (s *Store) SaveImage(img Image) error + func (s *Store) SavePost(p BlogPost) error + type ViewFuncs struct + AdminDashboard func(posts []BlogPost, message string, csrfToken string) templ.Component + AdminFormPartial func(post BlogPost, csrfToken string) templ.Component + AdminImages func(images []Image, csrfToken string) templ.Component + AdminLogin func(errorMsg string, csrfToken string, googleLoginURL string) templ.Component + BlogSection func(posts []BlogPost, activeTag string, tags []string) templ.Component + Home func(posts []BlogPost, activeTag string, tags []string, siteURL string) templ.Component + HomePartial func(posts []BlogPost, activeTag string, tags []string, siteURL string) templ.Component + NotFound func() templ.Component + Post func(post BlogPost, posts []BlogPost, siteURL string) templ.Component + PostPartial func(post BlogPost, posts []BlogPost, siteURL string) templ.Component + ServerError func() templ.Component v0.1.0 Mar 3, 2026