blog

package module
v0.0.0-...-6c3eac6 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: BSD-2-Clause Imports: 14 Imported by: 0

README

CHTJonas' Blog Software

Like every dev I've decided to reinvent the wheel and write my own blogging software. It's written in Go and should be fairly simple for others to understand and adapt for themselves should they so desire. The software is designed to be as simple as possible with the code being compiled to a static binary and the assets being baked in.

Usage

TODO

Compiling

TODO


This software is licensed under the BSD 2-Clause License.

Copyright (c) 2021 Charlie Jonas.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blog

type Blog struct {
	URL         string
	Title       string
	Description string
	OwnerName   string
	OwnerEmail  string
	YearCreated int
	// contains filtered or unexported fields
}

func (*Blog) CloseDB

func (b *Blog) CloseDB()

func (*Blog) GetAuthor

func (b *Blog) GetAuthor() *feeds.Author

func (*Blog) GetCopyright

func (b *Blog) GetCopyright() string
func (b *Blog) GetLink() *feeds.Link

func (*Blog) GetRSS

func (b *Blog) GetRSS() (string, error)

func (*Blog) GetSitemap

func (b *Blog) GetSitemap() string

func (*Blog) ListPosts

func (b *Blog) ListPosts() (*map[string]*Post, error)

func (*Blog) LoadPost

func (b *Blog) LoadPost(slug string) (*Post, error)

func (*Blog) OpenDB

func (b *Blog) OpenDB(path string) error

func (*Blog) SavePost

func (b *Blog) SavePost(slug string, post *Post) error

func (*Blog) SeedPosts

func (b *Blog) SeedPosts()

func (*Blog) Serve

func (b *Blog) Serve(addr string) (*Server, error)

type Post

type Post struct {
	UUID        string
	Title       string
	Created     time.Time
	Updated     time.Time
	AuthorName  string
	AuthorEmail string
	Content     string
	Tags        []string
	Draft       bool
	NoIndex     bool
}

func NewDraft

func NewDraft(title, content string) *Post

func NewPost

func NewPost(title, content string) *Post

func (*Post) GetAuthor

func (p *Post) GetAuthor() *feeds.Author

func (*Post) GetHTML

func (p *Post) GetHTML() string
func (p *Post) GetLink(slug string) *feeds.Link

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Start

func (serv *Server) Start(addr string) error

func (*Server) Stop

func (serv *Server) Stop(ctx context.Context) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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