Skip to content

webtools.zola #

fn build #

fn build(source_path string, build_path string) !

fn new #

fn new(zola_ Zola) !Zola

fn site_open #

fn site_open(name string) !

enum SortBy #

enum SortBy {
	@none
	date
	update_date
	title
	title_bytes
	weight
	slug
	order
}

struct App #

struct App {
	vweb.Context
	path pathlib.Path @[vweb_global]
}

fn (App) index #

fn (mut app App) index(path string) vweb.Result

struct Article #

struct Article {
pub:
	cid         string @[required]
	title       string
	page_path   string
	name        string
	image       ?&doctree.File
	tags        []string
	authors     []string
	categories  []string
	date        ourtime.OurTime
	page        ?&doctree.Page
	biography   string
	description string
}

struct ArticleAddArgs #

struct ArticleAddArgs {
pub mut:
	name       string
	collection string @[required]
	file       string @[required]
	image      string
	pointer    string
	page       string
}

struct Blog #

struct Blog {
	Section
mut:
	posts map[string]Post
}

Blog section for Zola site

struct BlogAddArgs #

@[params]
struct BlogAddArgs {
	Section
}

fn (Footer) export #

fn (mut footer Footer) export(content_dir string) !

struct FooterAddArgs #

struct FooterAddArgs {
pub:
	links    []Link
	template string
	logo     string
}

fn (Header) export #

fn (mut header Header) export(content_dir string) !

struct HeaderAddArgs #

struct HeaderAddArgs {
pub:
	items    []HeaderItem
	template string
	logo     string
}

struct News #

struct News {
	sort_by SortBy = .date
mut:
	articles map[string]Article
}

News section for Zola site

struct NewsAddArgs #

@[params]
struct NewsAddArgs {
	Section
}

struct Page #

struct Page {
	content     string
	title       string
	weight      int
	description string
	taxonomies  map[string][]string
	extra       map[string]Extra @[skip; str: skip]
}

struct PageAddArgs #

struct PageAddArgs {
pub:
	name       string
	collection string @[required]
	file       string @[required]
	homepage   bool
	template   string
	path       string
}

struct PageFrontMatter #

struct PageFrontMatter {
pub mut:
	id              string
	title           string
	description     string
	date            time.Time
	updated         time.Time
	weight          int
	draft           bool
	slug            string @[omitempty]
	path            string
	aliases         []string
	authors         []string
	in_search_index bool = true
	template        string
	taxonomies      map[string][]string
	extra           map[string]toml.Any
}

struct People #

struct People {
	Section
mut:
	persons map[string]Person
}

People section for Zola site

struct PeopleAddArgs #

@[params]
struct PeopleAddArgs {
	Section
}

struct Person #

struct Person {
pub:
	cid           string @[required]
	name          string
	page_path     string
	biography     string
	image         ?&doctree.File
	page          ?&doctree.Page
	description   string
	organizations []string
	categories    []string
	memberships   []string
	countries     []string
	cities        []string
}

struct PersonAddArgs #

struct PersonAddArgs {
pub mut:
	name       string
	page       string
	collection string
	file       string
	image      string
	pointer    string
}

struct Post #

struct Post {
pub:
	cid         string @[required]
	title       string
	name        string
	image       ?&doctree.File
	page        ?&doctree.Page
	date        ourtime.OurTime
	biography   string
	description string
	tags        []string
	categories  []string
	authors     []string
	countries   []string
	cities      []string
}

struct PostAddArgs #

struct PostAddArgs {
pub mut:
	name       string
	page       string
	collection string
	file       string
	pointer    string
	image      string
}

struct Section #

struct Section {
	SectionFrontMatter
pub:
	name string
pub mut:
	pages []ZolaPage @[skip; str: skip]
}

fn (Section) page_add #

fn (mut section Section) page_add(page_ ZolaPage) !

fn (Section) export #

fn (mut section Section) export(dest_dir string) !

struct SectionFrontMatter #

struct SectionFrontMatter {
pub:
	title               string
	description         string
	draft               bool
	sort_by             SortBy
	weight              int
	template            string
	page_template       string
	paginate_by         int
	paginate_path       string = 'page'
	paginate_reversed   bool
	insert_anchor_links InsertAnchorLinks
	in_search_index     bool = true
	render              bool = true
	redirect_to         string
	transparent         bool
	aliases             []string
	generate_feed       bool
	// extra               map[string]Extra
}

struct ServeParams #

@[params]
struct ServeParams {
	port int  = 9998
	open bool = true
}

struct Template #

struct Template {
	url string
}

struct Zola #

@[heap]
struct Zola {
pub mut:
	path_build   string
	path_publish string
	tailwindcss  bool = true
	install      bool = true
	reset        bool
	sites        map[string]&ZolaSite
}

fn (Zola) new #

fn (mut self Zola) new(args_ ZolaSiteArgs) !&ZolaSite

fn (Zola) get #

fn (mut self Zola) get(name_ string) !&ZolaSite

struct ZolaPage #

struct ZolaPage {
	PageFrontMatter
	doctree.Page
pub mut:
	name     string
	path     string
	homepage bool
	template string
	document elements.Doc   // markdown document of the page
	assets   []pathlib.Path // a list of paths to assets
}

ZolaPage extends doctree page with zola specific metadata

fn (ZolaPage) export #

fn (mut page ZolaPage) export(content_dir string) !

struct ZolaSite #

@[heap]
struct ZolaSite {
pub mut:
	name         string
	url          string @[required] // base url of site
	title        string
	description  string
	path_build   pathlib.Path
	path_publish pathlib.Path
	// zola         &Zola              @[skip; str: skip]
	tree      doctree.Tree @[skip; str: skip]
	pages     []ZolaPage
	header    ?Header
	footer    ?Footer
	blog      Blog
	people    ?People
	news      ?News
	sections  map[string]Section
	templates []Template
}

fn (ZolaSite) add_section #

fn (mut site ZolaSite) add_section(section_ Section) !

fn (ZolaSite) article_add #

fn (mut site ZolaSite) article_add(args ArticleAddArgs) !

fn (ZolaSite) blog_add #

fn (mut site ZolaSite) blog_add(args BlogAddArgs) !

adds a blog section to the zola site

fn (ZolaSite) content_add #

fn (mut site ZolaSite) content_add(args gittools.GSCodeGetFromUrlArgs) !

add content from website, can be more than 1, will sync but not overwrite to the destination website

 path   string
 url    string
 branch string
 sshkey string
 pull   bool // will pull if this is set
 reset  bool // this means will pull and reset all changes
 reload bool // reload the cache

fn (ZolaSite) doctree_add #

fn (mut site ZolaSite) doctree_add(args gittools.GSCodeGetFromUrlArgs) !

add collections from doctree

 path   string
 url    string
 branch string
 sshkey string
 pull   bool // will pull if this is set
 reset  bool // this means will pull and reset all changes
 reload bool // reload the cache

fn (ZolaSite) footer_add #

fn (mut site ZolaSite) footer_add(args FooterAddArgs) !

fn (ZolaSite) generate #

fn (mut site ZolaSite) generate() !

fn (ZolaSite) header_add #

fn (mut site ZolaSite) header_add(args HeaderAddArgs) !

fn (ZolaSite) header_dropdown_add #

fn (mut site ZolaSite) header_dropdown_add(args Dropdown) !

fn (ZolaSite) page_add #

fn (mut site ZolaSite) page_add(args PageAddArgs) !

fn (ZolaSite) people_add #

fn (mut site ZolaSite) people_add(args PeopleAddArgs) !

adds a people section to the zola site

fn (ZolaSite) person_add #

fn (mut site ZolaSite) person_add(args PersonAddArgs) !

fn (ZolaSite) post_add #

fn (mut site ZolaSite) post_add(args_ PostAddArgs) !

fn (ZolaSite) process #

fn (mut site ZolaSite) process() !

fn (ZolaSite) serve #

fn (mut site ZolaSite) serve(params ServeParams) !

fn (ZolaSite) template_add #

fn (mut site ZolaSite) template_add(args gittools.GSCodeGetFromUrlArgs) !

add template

 path   string
 url    string
 branch string
 sshkey string
 pull   bool // will pull if this is set
 reset  bool // this means will pull and reset all changes
 reload bool // reload the cache

struct ZolaSiteArgs #

@[params]
struct ZolaSiteArgs {
pub mut:
	name         string @[required]
	title        string
	description  string
	path_publish string // optional
	url          string = 'http://localhost:9998/' // base url of site
}