blog

package
v0.0.0-...-965a65e Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOT_MD                 string = ".md"
	ERROR_IN_FUNC          string = "error in func "
	MARKDOWN_PAGES_PATH    string = "pkg/markdown/pages/"
	MARKDOWN_POSTS_PATH    string = "pkg/markdown/posts/"
	TEMPLATE_HOME          string = "home"
	TEMPLATE_MARKDOWN_PAGE string = "markdownPage"
)

Variables

View Source
var BlogData = Metadata{
	Name: "your blog name",
	FooterLinks: []LinkData{
		{Text: "GITHUB", Url: ""},
		{Text: "LINKED IN", Url: ""},
		{Text: "TELEGRAM", Url: ""},
		{Text: "INSTAGRAM", Url: ""},
	},
	HeaderLinks: []LinkData{
		{Text: "ABOUT", Url: "/pages/about"},
		{Text: "CONTACT", Url: "/pages/contact"},
		{Text: "NOW", Url: "/pages/now"},
	},
	Summary: "another smart guy programmer blog 👨🏾‍💻 ",
}

Functions

func AddBlogActions

func AddBlogActions(echoServer *echo.Echo)

Types

type AppState

type AppState struct {
	Posts []MarkdownDocument
	Pages []MarkdownDocument
	Tags  []string
}

func BackdoorBootstrap

func BackdoorBootstrap() *AppState

type GoTemplateSet

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

type HtmlTemplateData

type HtmlTemplateData struct {
	Content template.HTML
}

type LinkData

type LinkData struct {
	Text string
	Url  string
}

type MarkdownDocument

type MarkdownDocument struct {
	PostMetaData  `yaml:"post_metadata" toml:"post_metadata" json:"post_metadata"`
	Content       []byte `yaml:"-" toml:"-" json:"-"`
	ContentString string `yaml:"content" toml:"content" json:"content"`
}

type Metadata

type Metadata struct {
	Name        string
	CurrentPost HtmlTemplateData
	CurrentPage HtmlTemplateData
	FooterLinks []LinkData
	HeaderLinks []LinkData
	Posts       []MarkdownDocument
	Pages       []MarkdownDocument
	Summary     string
}

type PostMetaData

type PostMetaData struct {
	IsDraft bool     `yaml:"is_draft" toml:"is_draft" json:"is_draft"`
	Key     string   `yaml:"key" toml:"key" json:"key"`
	Summary string   `yaml:"summary" toml:"summary" json:"summary"`
	Tags    []string `yaml:"tags" toml:"tags" json:"tags"`
	Title   string   `yaml:"title" toml:"title" json:"title"`
	Type    string   `yaml:"type" toml:"type" json:"type"`

	CreatedAt string `yaml:"created_at" toml:"created_at" json:"created_at"`
	UpdatedAt string `yaml:"updated_at" toml:"updated_at" json:"updated_at"`
}

Jump to

Keyboard shortcuts

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