Documentation ¶
Index ¶
- Constants
- func Copy(srcFile, dstFile string) error
- func CopyDirectory(scrDir, dest string) error
- func CopySymLink(source, dest string) error
- func CreateIfNotExists(dir string, perm os.FileMode) error
- func EnableParallelContent(content string) string
- func Exists(filePath string) bool
- func LoadFuncsAsPlugins(pluginsPath string) map[string]interface{}
- func Replace(content string, replacements []*Replaceable) string
- type Belbo
- type Config
- type Location
- type Page
- type Replaceable
Constants ¶
View Source
const ( DateLayout = "2006-01-02" DefaultBaseLayout = `{{ define "base_layout" }}{{ template "content" . }}{{ end }}` )
View Source
const PluginsFilename = "plugins.so"
Variables ¶
This section is empty.
Functions ¶
func CopyDirectory ¶
func CopySymLink ¶
func EnableParallelContent ¶
func LoadFuncsAsPlugins ¶ added in v0.2.1
func Replace ¶
func Replace(content string, replacements []*Replaceable) string
Replace replaces replaceables in the content with <span> elements
Types ¶
type Belbo ¶ added in v0.2.0
type Belbo struct { Fsys fs.FS Config *Config ContentDir []string TemplatesDir string Templates []string BuildDir string PluginsDir string Plugins map[string]interface{} Pages []*Page }
Belbo takes as input a file system and a configuration file to transform a bunch of MD and html templates into html
func (*Belbo) BuildPages ¶ added in v0.2.0
func (b *Belbo) BuildPages()
func (*Belbo) IsContentDir ¶ added in v0.2.0
type Config ¶ added in v0.2.0
type Config map[string]interface{}
Config represents a toml snippet
func (Config) GetStringSlice ¶ added in v0.2.0
type Location ¶
Location defines a location in the text content
func NonReplaceableAreas ¶
NonReplaceableAreas are places in the text that should be kept untouched. For now, take into account only text within <code> elements
type Page ¶
type Page struct { // Front-matter Config Config RawContent string // Html representation of the page Html template.HTML // Path before page is processed (e.g., posts/2020-01-12-example.md) RelativePath string // e.g., /posts/2020/01/example/index.html Url string Title string // Pointer to all the other pages AllPages []*Page // CreationDate for pages whose name includes a date CreatedAt time.Time BuildDir []string }
Page represents anything that may be written out as html
type Replaceable ¶
Replaceable represents a snippet of text that will be replaced by <span> elements
func FindReplaceablesSnippets ¶
func FindReplaceablesSnippets(content string) []*Replaceable
FindReplaceablesSnippets finds snippets in the form @{C1||C2||...||Cn}@ that will be replaced later by <span> elements.
Click to show internal directories.
Click to hide internal directories.