Documentation
¶
Overview ¶
Package pages contains templates for individual pages in a rendered blog.
Index ¶
- func Index(layout LayoutFunc, props IndexProps) templ.Component
- func Page(layout LayoutFunc, props PageProps) templ.Component
- func Post(layout LayoutFunc, props PostProps) templ.Component
- func PostIndex(layout LayoutFunc, props PostIndexProps) templ.Component
- func PostList(layout LayoutFunc, props PostListProps) templ.Component
- type IndexProps
- type LayoutFunc
- type PageProps
- type PostIndexEntryProps
- type PostIndexProps
- type PostListProps
- type PostProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Index ¶
func Index(layout LayoutFunc, props IndexProps) templ.Component
Index renders the "home" page.
func Page ¶
func Page(layout LayoutFunc, props PageProps) templ.Component
Page renders a page containing static HTML content.
func Post ¶
func Post(layout LayoutFunc, props PostProps) templ.Component
Post renders a page for a single blog post.
func PostIndex ¶
func PostIndex(layout LayoutFunc, props PostIndexProps) templ.Component
PostIndex renders a page containing a list of posts bucketed by a shared key e.g. an archive by year or listing by tag.
func PostList ¶
func PostList(layout LayoutFunc, props PostListProps) templ.Component
PostList renders a page containing a list of posts that share a common key e.g. posts for a specific year or tag.
Types ¶
type IndexProps ¶
type IndexProps struct { LatestPost *components.PostProps RecentPosts components.PostListProps }
type LayoutFunc ¶
LayoutFunc represents a function that takes the name of a specific page (e.g. "Home") and returns a component that can take other components as children; that is: a layout.
type PostIndexEntryProps ¶
type PostIndexProps ¶
type PostIndexProps struct { PageName string Entries []PostIndexEntryProps Prefix string }
type PostListProps ¶
type PostListProps struct { Heading string Posts components.PostListProps }
type PostProps ¶
type PostProps struct {
Post components.PostProps
}
Click to show internal directories.
Click to hide internal directories.