pages

package
v1.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pages contains templates for individual pages in a rendered blog.

Index

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

type LayoutFunc func(pageName string) templ.Component

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 PageProps

type PageProps struct {
	Content string
	Slug    string
}

type PostIndexEntryProps

type PostIndexEntryProps struct {
	Count int
	Key   string
}

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL