builder

package
v0.0.0-...-84a407a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigYaml

func ConfigYaml() error

func CreateRoute

func CreateRoute(fs afero.Fs, routeType RouteType, slug string, result RenderResult) error

func GenerateRSS

func GenerateRSS(posts []Post, UrlUser string, baseUrl string, descrp string, author string, email string)

func GenerateSitemap

func GenerateSitemap(posts []Post, UrlUser string, BaseUrl string)

func MinifyCSS

func MinifyCSS(fs afero.Fs)

func RunBuild

func RunBuild(fs afero.Fs, isDev bool)

Types

type Builder

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

func (*Builder) BuildPage

func (b *Builder) BuildPage(contentTemplate string, data any) (RenderResult, error)

func (*Builder) BuildPosts

func (b *Builder) BuildPosts(isDev bool, fs afero.Fs, baseUrl string, allPosts []Post, active bool, userUrl string, emailDir string)

func (*Builder) InitTemplates

func (b *Builder) InitTemplates() ([]string, error)

Init de templates

type Config

type Config struct {
	UserUrl        string `yaml:"userUrl"`
	BaseURL        string `yaml:"baseUrl"`
	SiteTitle      string `yaml:"siteTitle"`
	Email          string `yaml:"email"`
	UseSectionPost struct {
		Active      bool `yaml:"active"`
		LimitOfPost int  `yaml:"limitOfPost"`
	} `yaml:"useSectionPost"`
	UsePinned struct {
		Active bool `yaml:"active"`
	} `yaml:"usePinned"`
}

func LoadConfig

func LoadConfig() (Config, error)

type Post

type Post struct {
	Title       string `yaml:"title"`
	Date        string `yaml:"date"`
	Author      string `yaml:"author"`
	Email       string `yaml:"email"`
	Body        string `yaml:"body"`
	Description string `yaml:"description"`
	Fijado      bool   `yaml:"fijado"`
	Link        string
	FullLink    string
	UrlUser     string
}

func LoadPosts

func LoadPosts() ([]Post, error)

func (Post) ContentBody

func (p Post) ContentBody() template.HTML

type RenderResult

type RenderResult struct {
	FolderName string
	Content    []byte
}

type RouteType

type RouteType int
const (
	RoutePublic RouteType = iota
	RoutePost
)

Jump to

Keyboard shortcuts

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