Documentation
¶
Index ¶
- Variables
- type AuthorBlock
- type ColorScheme
- type Config
- type FontFamily
- type NavigationR
- type NavigationW
- type Pagination
- type PostCount
- type PostR
- func (p *PostR) Cover() string
- func (p *PostR) Excerpt() string
- func (p *PostR) IsPublished() bool
- func (p *PostR) PublishedAtDatetime() string
- func (p *PostR) PublishedAtISO() string
- func (p *PostR) PublishedDate() string
- func (p *PostR) PublishedDay() string
- func (p *PostR) PublishedMonth() string
- func (p *PostR) PublishedYear() string
- func (p *PostR) TagNames() []string
- func (p *PostR) TagsStr() string
- type PostW
- type TagR
- type TagW
- type UserR
- type UserW
- type Visibility
Constants ¶
This section is empty.
Variables ¶
View Source
var Locales = map[string]string{
"台灣正體": "zh-tw",
"English": "en-us",
"简体中文": "zh-cn",
}
View Source
var PageTypes = map[string]string{
"/admin/users": "user",
"/admin/user/:id": "user",
"/admin/posts": "post",
"/admin/post/create": "post",
"/admin/post/:id": "post",
"/admin/tags": "tag",
"/admin/tag/:id": "tag",
"/admin/photos": "media",
"/admin/navigations": "navigation",
"/admin/settings": "settings",
"/admin/appearances": "appearances",
}
View Source
var RelativeRoots = map[string]string{
"/wizard": "../../",
"/login": "../../",
"/admin/users": "../../",
"/admin/navigations": "../../",
"/admin/tags": "../../",
"/admin/settings": "../../",
"/admin/appearances": "../../",
"/admin/posts": "../../",
"/admin/photos": "../../",
"/tag/:tag": "../../",
"/author/:author": "../../",
"/archive/:year": "../../",
"/post/:slug": "../../",
"/admin/user/:id": "../../../",
"/navigations/edit": "../../../",
"/admin/tag/:id": "../../../",
"/admin/appearances/injected": "../../../",
"/admin/post/create": "../../../",
"/admin/trashes/clear": "../../../",
"/admin/post/:id": "../../../",
"/archive/:year/:month": "../../../",
"/admin/tag/:id/delete": "../../../../",
"/admin/post/:id/delete": "../../../../",
"/admin/post/:id/trash": "../../../../",
"/admin/post/:id/untrash": "../../../../",
"/archive/:year/:month/:day": "../../../../",
}
View Source
var Timezones = map[string]int{
"UTC-12:00": -60 * 60 * 12,
"UTC-11:30": -60 * 60 * 11.5,
"UTC-11:00": -60 * 60 * 11,
"UTC-10:30": -60 * 60 * 10.5,
"UTC-10:00": -60 * 60 * 10,
"UTC-09:30": -60 * 60 * 9.5,
"UTC-09:00": -60 * 60 * 9,
"UTC-08:30": -60 * 60 * 8.5,
"UTC-08:00": -60 * 60 * 8,
"UTC-07:30": -60 * 60 * 7.5,
"UTC-07:00": -60 * 60 * 7,
"UTC-06:30": -60 * 60 * 6.5,
"UTC-06:00": -60 * 60 * 6,
"UTC-05:30": -60 * 60 * 5.5,
"UTC-05:00": -60 * 60 * 5,
"UTC-04:30": -60 * 60 * 4.5,
"UTC-04:00": -60 * 60 * 4,
"UTC-03:30": -60 * 60 * 3.5,
"UTC-03:00": -60 * 60 * 3,
"UTC-02:30": -60 * 60 * 2.5,
"UTC-02:00": -60 * 60 * 2,
"UTC-01:30": -60 * 60 * 1.5,
"UTC-01:00": -60 * 60 * 1,
"UTC-00:30": -60 * 60 * 0.5,
"UTC+00:00": 0,
"UTC+00:30": +60 * 60 * 0.5,
"UTC+01:00": +60 * 60 * 1,
"UTC+01:30": +60 * 60 * 1.5,
"UTC+02:00": +60 * 60 * 2,
"UTC+02:30": +60 * 60 * 2.5,
"UTC+03:00": +60 * 60 * 3,
"UTC+03:30": +60 * 60 * 3.5,
"UTC+04:00": +60 * 60 * 4,
"UTC+04:30": +60 * 60 * 4.5,
"UTC+05:00": +60 * 60 * 5,
"UTC+05:30": +60 * 60 * 5.5,
"UTC+05:45": +60 * 60 * 5.75,
"UTC+06:00": +60 * 60 * 6,
"UTC+06:30": +60 * 60 * 6.5,
"UTC+07:00": +60 * 60 * 7,
"UTC+07:30": +60 * 60 * 7.5,
"UTC+08:00": +60 * 60 * 8,
"UTC+08:30": +60 * 60 * 8.5,
"UTC+08:45": +60 * 60 * 8.75,
"UTC+09:00": +60 * 60 * 9,
"UTC+09:30": +60 * 60 * 9.5,
"UTC+10:00": +60 * 60 * 10,
"UTC+10:30": +60 * 60 * 10.5,
"UTC+11:00": +60 * 60 * 11,
"UTC+11:30": +60 * 60 * 11.5,
"UTC+12:00": +60 * 60 * 12,
"UTC+12:45": +60 * 60 * 12.75,
"UTC+13:00": +60 * 60 * 13,
"UTC+13:45": +60 * 60 * 13.75,
"UTC+14:00": +60 * 60 * 14,
}
Functions ¶
This section is empty.
Types ¶
type AuthorBlock ¶
type AuthorBlock string
const ( AuthorBlockNone AuthorBlock = "none" AuthorBlockStart AuthorBlock = "start" AuthorBlockEnd AuthorBlock = "end" )
type ColorScheme ¶
type ColorScheme string
const ( ColorSchemeLight ColorScheme = "light" ColorSchemeDark ColorScheme = "dark" ColorSchemeAuto ColorScheme = "" )
type Config ¶
type Config struct {
Name string `json:"name"`
Description string `json:"description"`
IsPublic bool `json:"is_public"`
DateFormat string `json:"date_format"`
TimeFormat string `json:"time_format"`
Timezone int `json:"timezone"`
InjectedHead string `json:"injected_head"`
InjectedFoot string `json:"injected_foot"`
InjectedPostStart string `json:"injected_post_start"`
InjectedPostEnd string `json:"injected_post_end"`
ColorScheme ColorScheme `json:"color_scheme"`
ContainerWidth string `json:"container_width"`
FontFamily FontFamily `json:"font_family"`
FontSize string `json:"font_size"`
HighlightJS bool `json:"highlight_js"`
AuthorBlock AuthorBlock `json:"author_block"`
PostsPerPage int `json:"posts_per_page"`
Theme string `json:"theme"`
Locale string `json:"locale"`
}
func (*Config) IsCustomDateFormat ¶
func (*Config) IsCustomTimeFormat ¶
type FontFamily ¶
type FontFamily string
const ( FontFamilyNotoSans FontFamily = "sans" FontFamilyNotoSerif FontFamily = "serif" )
type NavigationR ¶
type NavigationR struct {
}
type NavigationW ¶
type NavigationW struct {
}
type Pagination ¶
type PostR ¶
type PostR struct {
ID string
Title string
Slug string
OriginalExcerpt string
AuthorID string
Password string
Visibility Visibility
Content string
PinnedAt int64
PublishedAt int64
CreatedAt int64
UpdatedAt int64
TrashedAt int64
Author UserR
Tags []*TagR
}
func (*PostR) IsPublished ¶
func (*PostR) PublishedAtDatetime ¶
func (*PostR) PublishedAtISO ¶
func (*PostR) PublishedDate ¶
func (*PostR) PublishedDay ¶
func (*PostR) PublishedMonth ¶
func (*PostR) PublishedYear ¶
type UserR ¶
type Visibility ¶
type Visibility string
const ( VisibilityUnknown Visibility = "" VisibilityPublic Visibility = "public" VisibilityPrivate Visibility = "private" VisibilityPassword Visibility = "password" VisibilityDraft Visibility = "draft" VisibilityTrash Visibility = "trash" // trash doesn't really exists, it's an abstraction )
Click to show internal directories.
Click to hide internal directories.