tmplrndr

package
v0.0.0-...-beda15e Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tmplrndr This package is responsible of rendenring templates in a sane(type safe) way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AboutProps

type AboutProps struct {
	PrerenderedMarkdown   string
	RenderedMarkdown      string
	Technologies          []string
	BigScreenTechnologies [][]string
}

type BlogPostPreview

type BlogPostPreview struct {
	Title       string
	Description string
	PublicId    string
	VisitTimes  uint
	WrittenAt   string
}

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 Experience struct {
	Title       string
	Description string
	Location    string
	StartDate   string
	EndDate     string
	Roles       []string
}

type ExperienceGroup

type ExperienceGroup struct {
	Name string
	Xps  []Experience
}

type IndexProps

type IndexProps struct {
	Name  string
	Brief string
}

type MarkdownViewerProps

type MarkdownViewerProps struct {
	Markdown string
}

type ProjectGroup

type ProjectGroup struct {
	Title       string
	Description string
	Order       int
	PublicId    string
	Projects    []struct {
		Name        string
		Description string
		LogoUrl     string
		SourceCode  string
		Website     string
		StartYear   string
		EndYear     string
		ComingSoon  bool
	}
}

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]

func NewXPs

func NewXPs() Template[XPsProps]

type TemplateProps

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
}

Jump to

Keyboard shortcuts

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