server

package
v0.0.0-...-f09091e Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_TEMPLATE = "./templates/base.tmpl"
View Source
const BLOG_BASE_PATH = "blog"
View Source
const BLOG_PAGE_TEMPLATE = "./templates/blog.tmpl"
View Source
const BLOG_POST_TEMPLATE = "./templates/blog_post.tmpl"
View Source
const MD_PATH = "markdown"
View Source
const PAGE_TEMPLATE = "./templates/page.tmpl"
View Source
const THEME = "modus-vivendi"

Variables

View Source
var LINKS_PATH = "config/links.yml"

Functions

func CopyDirectory

func CopyDirectory(source, dest string) error

func CopyFile

func CopyFile(source, dest string)

func CreateNewMarkdownFile

func CreateNewMarkdownFile(title string, path string)

func GenerateAtomFeed

func GenerateAtomFeed(posts []BlogPost, outputPath string)

Types

type BlogMetadata

type BlogMetadata struct {
	Title       string    `yaml:"title"`
	IsPublished bool      `yaml:"published"`
	Date        time.Time `yaml:"date"`
	Slug        string    `yaml:"slug"`
	Tags        []string  `yaml:"tags"`
}

type BlogPageTemplateArgs

type BlogPageTemplateArgs struct {
	Nav       NavBar
	Title     string
	Body      string
	BlogItems []BlogPost
	Links     LinkMetadata
}

type BlogPost

type BlogPost struct {
	Slug     string
	Path     string
	Body     string
	Metadata BlogMetadata
}

func (*BlogPost) FormatDate

func (post *BlogPost) FormatDate() string

type BlogRenderCache

type BlogRenderCache struct {
	Prefix                string
	OutputPath            string
	Items                 []BlogPost
	ShouldListUnpublished bool
	Links                 LinkMetadata
	// contains filtered or unexported fields
}

type ExternalPostsMetadata

type ExternalPostsMetadata struct {
	Title string    `yaml:"title"`
	Link  string    `yaml:"link"`
	Date  time.Time `yaml:"date"`
}

func (ExternalPostsMetadata) FormatDate

func (epm ExternalPostsMetadata) FormatDate() string

type LinkMetadata

type LinkMetadata struct {
	Profiles []ProfileMetadata       `yaml:"profiles"`
	External []ExternalPostsMetadata `yaml:"external_posts"`
}
func NewLinks() LinkMetadata

type MarkdownFileEntry

type MarkdownFileEntry struct {
	Content []byte
	Key     string
	Prefix  string
}

func GetAllMarkdownFiles

func GetAllMarkdownFiles() []MarkdownFileEntry

type MarkdownRenderer

type MarkdownRenderer struct {
	// contains filtered or unexported fields
}

func NewMarkdownRenderer

func NewMarkdownRenderer() MarkdownRenderer

func (*MarkdownRenderer) RenderBytes

func (mr *MarkdownRenderer) RenderBytes(contents []byte) (map[string]any, string)
type NavBar struct {
	Items []NavBarItem
}
type NavBarItem struct {
	Key  string
	Link string
}

type PageTemplateArgs

type PageTemplateArgs struct {
	Nav   NavBar
	Title string
	Body  string
	Links LinkMetadata
}

type ProfileMetadata

type ProfileMetadata struct {
	Title string `yaml:"title"`
	Link  string `yaml:"link"`
}

func (ProfileMetadata) SVGSource

func (pm ProfileMetadata) SVGSource() string

type RenderedMarkdown

type RenderedMarkdown struct {
	Entry   MarkdownFileEntry
	Meta    map[string]any
	Content string
}

type SiteBuilder

type SiteBuilder struct {
	InputPath       string
	OutputPath      string
	ListUnpublished bool
}

func NewSiteBuilder

func NewSiteBuilder(inputPath string, outputPath string) *SiteBuilder

func (SiteBuilder) Build

func (b SiteBuilder) Build()

type TemplateRenderer

type TemplateRenderer struct {
	// contains filtered or unexported fields
}

func NewTemplateRenderer

func NewTemplateRenderer() *TemplateRenderer

func (*TemplateRenderer) AddTemplate

func (t *TemplateRenderer) AddTemplate(paths ...string)

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(out io.Writer, path string, data any)

func (*TemplateRenderer) RenderBlogPage

func (t *TemplateRenderer) RenderBlogPage(p BlogPageTemplateArgs) []byte

func (*TemplateRenderer) RenderBlogPost

func (t *TemplateRenderer) RenderBlogPost(p PageTemplateArgs) []byte

func (*TemplateRenderer) RenderPage

func (t *TemplateRenderer) RenderPage(p PageTemplateArgs) []byte

func (*TemplateRenderer) WithDefault

func (t *TemplateRenderer) WithDefault() *TemplateRenderer

Jump to

Keyboard shortcuts

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