Documentation
¶
Overview ¶
Package tmplrndr This package is responsible of rendenring templates in a sane(type safe) way.
Index ¶
- type AboutProps
- type BlogPostPreview
- type BlogPostProps
- type BlogsProps
- type ErrorProps
- type Experience
- type ExperienceGroup
- type IndexProps
- type MarkdownViewerProps
- type ProjectGroup
- type ProjectsProps
- type Template
- func NewAbout() Template[AboutProps]
- func NewBlogPost() Template[BlogPostProps]
- func NewBlogs() Template[BlogsProps]
- func NewError() Template[ErrorProps]
- func NewIndex() Template[IndexProps]
- func NewMarkdownViewer() Template[MarkdownViewerProps]
- func NewProjects() Template[ProjectsProps]
- func NewXPs() Template[XPsProps]
- type TemplateProps
- type XPsProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AboutProps ¶
type BlogPostPreview ¶
type BlogPostProps ¶
type BlogPostProps struct { BlogPostPreview Content string }
type BlogsProps ¶
type BlogsProps struct { BlogIntro string Blogs []BlogPostPreview }
type ErrorProps ¶
type ErrorProps struct { }
type Experience ¶
type ExperienceGroup ¶
type ExperienceGroup struct { Name string Xps []Experience }
type IndexProps ¶
type MarkdownViewerProps ¶
type MarkdownViewerProps struct {
Markdown string
}
type ProjectGroup ¶
type ProjectsProps ¶
type ProjectsProps struct {
Groups []ProjectGroup
}
type Template ¶
type Template[T TemplateProps] interface { // Render accepts a generic prop type T, // and renders the templates with its props into the returned reader. Render(props T) io.Reader }
Template is an interface that represents a renderable html template.
func NewAbout ¶
func NewAbout() Template[AboutProps]
func NewBlogPost ¶
func NewBlogPost() Template[BlogPostProps]
func NewBlogs ¶
func NewBlogs() Template[BlogsProps]
func NewError ¶
func NewError() Template[ErrorProps]
NewError returns a new error template instance.
func NewIndex ¶
func NewIndex() Template[IndexProps]
NewIndex returns a new index template instance.
func NewMarkdownViewer ¶
func NewMarkdownViewer() Template[MarkdownViewerProps]
func NewProjects ¶
func NewProjects() Template[ProjectsProps]
type TemplateProps ¶
type TemplateProps interface { IndexProps | ProjectsProps | XPsProps | MarkdownViewerProps | AboutProps | BlogsProps | BlogPostProps | ErrorProps }
TemplateProps is a TYPED pages props, so that all pages get their props without any funny business when matching names and types.
type XPsProps ¶
type XPsProps struct { ProfessionalWork ExperienceGroup Volunteering ExperienceGroup }
Click to show internal directories.
Click to hide internal directories.