site

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

site.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	Title   string
	Slug    string
	URL     string
	Content template.HTML
}

type Post

type Post struct {
	Title        string
	Date         time.Time
	Tags         []string
	Slug         string
	URL          string
	Summary      string
	Author       string
	Cover        string            // 生成后的 URL 路径, 空表示无封面
	CoverSrc     string            // 构建期使用的源文件绝对路径
	BundleImages map[string]string // markdown 中引用的图片: 相对路径 -> 绝对路径
	Content      template.HTML
	TOC          template.HTML
}

type Site

type Site struct {
	Config *config.Config
	Posts  []Post
	Tags   map[string][]Post
	Pages  map[string]Page
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) *Site

func (*Site) Build

func (s *Site) Build(projectRoot, outDir string) error

Jump to

Keyboard shortcuts

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