Documentation
¶
Index ¶
- Variables
- func CopyDir(src, dst string)
- func CopyFile(src, dst string)
- func Mkdir(base, ext string)
- func WriteWriting(website Website, writing Writinger, outputPath string, ...)
- type ElementPage
- type PostWriting
- type PostWritingContext
- type PostsPage
- type PostsPageContext
- type PostsPages
- type SetPageContext
- type Website
- func (w Website) Categories() []ElementPage
- func (w Website) HasStyle() bool
- func (w Website) License() string
- func (w Website) Pages() []Writing
- func (w Website) Posts() []PostWriting
- func (w Website) PostsPages() PostsPages
- func (w *Website) SetStyle(style string)
- func (w Website) Style() string
- func (w Website) Title() string
- type Writing
- type WritingContext
- type Writinger
Constants ¶
This section is empty.
Variables ¶
var BasicTemplates embed.FS
var SetTemplates embed.FS
var WritingTemplates embed.FS
Functions ¶
Types ¶
type ElementPage ¶
type ElementPage struct {
// contains filtered or unexported fields
}
func (ElementPage) Name ¶
func (s ElementPage) Name() string
func (ElementPage) Posts ¶
func (s ElementPage) Posts() []PostWriting
func (ElementPage) Url ¶
func (s ElementPage) Url() string
type PostWriting ¶
type PostWriting struct {
// contains filtered or unexported fields
}
PostWriting is an spectific struct for post that implements the Writinger interface. Its methods are the same in behavior as the Writing struct
func NewPostWriting ¶
func NewPostWriting(post manager.Post, baseUrl string) PostWriting
func (PostWriting) RenderContent ¶
func (pw PostWriting) RenderContent() string
func (PostWriting) RenderHeader ¶
func (pw PostWriting) RenderHeader() string
func (PostWriting) RenderPartialContent ¶
func (pw PostWriting) RenderPartialContent(n int) string
func (PostWriting) Url ¶
func (pw PostWriting) Url() string
type PostWritingContext ¶
type PostWritingContext struct { Writing PostWriting Website Website }
type PostsPage ¶
type PostsPage struct {
// contains filtered or unexported fields
}
PostsPage stores info about the PostsPages which it belongs, index, a list of writings related to this PostsPage and its url.
func (PostsPage) Last ¶
Last returns the last PostsPage on this PostsPage. Returns an empty PostsPage if not.
func (PostsPage) Next ¶
Next returns the next PostsPage on this PostsPage. Returns an empty PostsPage if is not possible.
func (PostsPage) Writings ¶
func (p PostsPage) Writings() []PostWriting
Writinngs returns the writings stored in this PostsPage
type PostsPageContext ¶
type PostsPages ¶
type PostsPages []PostsPage
PostsPages is defined type for a slice of PostsPage.
func NewPostsPages ¶
func NewPostsPages(postsPerPage int, posts []PostWriting, base string) PostsPages
type SetPageContext ¶
type SetPageContext struct { ElementPage ElementPage Website Website }
type Website ¶
type Website struct {
// contains filtered or unexported fields
}
Website represents a website with its posts PostsPage and PostsPage.
func NewWebsite ¶
func NewWebsite(title string, postsPerPage int, posts []manager.Post, pages []manager.Page, content manager.Content) Website
NewWebsite returns info about the website.
func (Website) Categories ¶
func (w Website) Categories() []ElementPage
func (Website) PostsPages ¶
func (w Website) PostsPages() PostsPages
PostsPages returns its PostsPages.
type Writing ¶
type Writing struct {
// contains filtered or unexported fields
}
Writing stores a copy of the manager.File and a final url of the post
func NewWriting ¶
NewWriting constructs a Writing value with a baseUrl to be used along with the the manager.File Name
func (Writing) RenderContent ¶
RenderContent returns HTML from a markdown format writing
func (Writing) RenderHeader ¶
RenderHeader returns info about this file stored in the database to be used as a header
func (Writing) RenderPartialContent ¶
RenderPartialContent returns up to 'n' characters from the markdown file