Documentation
¶
Index ¶
- Constants
- func NewPostID(slug string, t time.Time) string
- type BunnyCDN
- type Comments
- type Config
- type Core
- func (co *Core) AddOrUpdateWebmention(id string, mention *Mention, sourceOrURL string) error
- func (co *Core) BaseURL() *url.URL
- func (co *Core) Build(cleanBuildDirectory bool) error
- func (co *Core) DeleteWebmention(id, sourceOrURL string) error
- func (co *Core) GetEntries(includeList bool) (Entries, error)
- func (co *Core) GetEntry(id string) (*Entry, error)
- func (co *Core) GetEntryFromPermalink(permalink string) (*Entry, error)
- func (co *Core) GetEntryLinks(permalink string, withSyndications bool) ([]string, error)
- func (co *Core) GetGone() (map[string]bool, error)
- func (co *Core) GetRedirects(ignoreMalformed bool) (map[string]string, error)
- func (co *Core) IsLinkValid(permalink string) (bool, error)
- func (co *Core) MkdirAll(filename string) error
- func (co *Core) NewBlankEntry(id string) *Entry
- func (co *Core) ReadDir(filename string) ([]os.FileInfo, error)
- func (co *Core) ReadFile(filename string) ([]byte, error)
- func (co *Core) ReadJSON(filename string, v interface{}) error
- func (co *Core) RemoveAll(path string) error
- func (co *Core) SaveEntry(e *Entry) error
- func (co *Core) SendWebmentions(permalink string, otherTargets ...string) error
- func (co *Core) ShouldBuild() (bool, error)
- func (co *Core) Stat(filename string) (os.FileInfo, error)
- func (co *Core) Sync() ([]string, error)
- func (f *Core) UpdateSidecar(entry *Entry, t func(*Sidecar) (*Sidecar, error)) error
- func (co *Core) WriteFile(filename string, data []byte, message string) error
- func (co *Core) WriteFiles(filesAndData map[string][]byte, message string) error
- func (co *Core) WriteJSON(filename string, data interface{}, message string) error
- type Entries
- type Entry
- type FrontMatter
- type ImgProxy
- type Login
- type MeiliSearch
- type Mention
- type Micropub
- type Notifications
- type Notifier
- type ServerConfig
- type Sidecar
- type SiteConfig
- type Telegram
- type Webmentions
Constants ¶
View Source
const ( SpecialSection = "posts" SpecialTaxonomy = "categories" )
View Source
const ( ContentDirectory string = "content" DataDirectory string = "data" RedirectsFile = "redirects" GoneFile = "gone" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { ServerConfig Site SiteConfig }
func ParseConfig ¶
ParseConfig parses the configuration from the default files and paths.
type Core ¶
type Core struct { BuildHook func(string) // called when the build directory has changed // contains filtered or unexported fields }
func (*Core) AddOrUpdateWebmention ¶
func (*Core) DeleteWebmention ¶
func (*Core) GetEntryFromPermalink ¶
func (*Core) GetEntryLinks ¶
GetEntryLinks gets the links found in the HTML rendered version of the entry. This uses the latest available build to check for the links. Entry must have .h-entry and .e-content classes.
func (*Core) GetRedirects ¶
func (*Core) IsLinkValid ¶
IsLinkValid checks if the given link exists in the built version of the website.
func (*Core) NewBlankEntry ¶
func (*Core) SendWebmentions ¶
func (*Core) ShouldBuild ¶
ShouldBuild returns true if the website has to be built. This should only return true after initialization.
func (*Core) UpdateSidecar ¶
func (*Core) WriteFiles ¶
type Entry ¶
type Entry struct { FrontMatter ID string IsList bool Permalink string RelPermalink string Content string }
func (*Entry) TextContent ¶
type FrontMatter ¶
type FrontMatter struct { Title string `yaml:"title,omitempty"` Description string `yaml:"description,omitempty"` Draft bool `yaml:"draft,omitempty"` Date time.Time `yaml:"date,omitempty"` Lastmod time.Time `yaml:"lastmod,omitempty"` ExpiryDate time.Time `yaml:"expiryDate,omitempty"` NoIndex bool `yaml:"noIndex,omitempty"` NoWebmentions bool `yaml:"noWebmentions,omitempty"` Other map[string]any `yaml:",inline"` }
type MeiliSearch ¶
type Mention ¶
type Mention struct { xray.Post Source string `json:"source,omitempty"` ID string `json:"-"` EntryID string `json:"-"` }
func (*Mention) IsInteraction ¶
type Notifications ¶
type Notifications struct {
Telegram *Telegram
}
type ServerConfig ¶
type ServerConfig struct { Development bool SourceDirectory string PublicDirectory string DataDirectory string Port int BaseURL string // NOTE: maybe use the one from [SiteConfig]. TokensSecret string WebhookSecret string Tor bool Login Login Comments Comments Webmentions Webmentions Micropub *Micropub Notifications Notifications BunnyCDN *BunnyCDN MeiliSearch *MeiliSearch ImgProxy *ImgProxy Plugins map[string]map[string]interface{} }
func (*ServerConfig) AbsoluteURL ¶
func (c *ServerConfig) AbsoluteURL(refStr string) string
func (*ServerConfig) ID ¶
func (c *ServerConfig) ID() string
type Sidecar ¶
type SiteConfig ¶
type Webmentions ¶
type Webmentions struct {
Secret string
}
Click to show internal directories.
Click to hide internal directories.