-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.go
114 lines (111 loc) · 6.75 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package main
import (
"regexp"
"time"
)
const (
appVersion = "1.5.5"
defaultGitHubRepoUrl = "github.com/kion/mbgen"
defaultGitHubRepoThemesUrl = defaultGitHubRepoUrl + "/themes"
defaultGitHubRepoPageContentSamplesUrl = defaultGitHubRepoUrl + "/content-samples/pages"
defaultGitHubRepoPostContentSamplesUrl = defaultGitHubRepoUrl + "/content-samples/posts"
defaultGitHubRepoDeployDirContentSamplesUrl = defaultGitHubRepoUrl + "/content-samples/deploy"
themesDirName = "themes"
resourcesDirName = "resources"
templatesDirName = "templates"
includeDirName = "include"
templateFileExtension = ".html"
mainTemplateFileName = "main" + templateFileExtension
pageTemplateFileName = "page" + templateFileExtension
postTemplateFileName = "post" + templateFileExtension
mediaTemplateFileName = "media" + templateFileExtension
archiveTemplateFileName = "archive" + templateFileExtension
tagIndexTemplateFileName = "tag-index" + templateFileExtension
searchTemplateFileName = "search" + templateFileExtension
pagerTemplateFileName = "pager" + templateFileExtension
contentDirectiveTemplateFileNameFormat = "content-%s" + templateFileExtension
contentFileExtension = ".html"
indexPageFileName = "index" + contentFileExtension
searchPageFileName = "search" + contentFileExtension
searchIndexFileName = "search.json"
directivePlaceholderReplacementFormat = ":@@@:%s:@@@:"
hashTagMarkdownReplacementFormat = "[#%s](/" + deployTagsDirName + "/%s/)"
stylesFileName = "styles.css"
stylesIncludeFileNameFormat = "styles-include-%s.css"
markdownPagesDirName = "pages"
markdownPostsDirName = "posts"
markdownFileExtension = ".md"
mediaDirName = "media"
deployDirName = "deploy"
deployPostDirName = "post"
deployPostsDirName = "posts"
deployPageDirName = "page"
deployArchiveDirName = "archive"
deployTagsDirName = "tags"
metaDataKeyDate = "date"
metaDataKeyTime = "time"
metaDataKeyTitle = "title"
metaDataKeyTags = "tags"
configFileName = "config.yml"
defaultGenerateArchive = true
defaultGenerateTagIndex = true
defaultEnableSearch = true
defaultPageSize = 10
minAllowedThumbWidth = 320
minAllowedThumbThreshold = 0.3
defaultThumbThreshold = 0.5
defaultUseThumbs = true
defaultServeHost = "localhost"
defaultServePort = 8888
thumbImgFileSuffix = "_thumb"
pageHeadIncludePrefix = "page-head--"
defaultThemeName = "pretty-dark"
defaultThemeAlias = "default"
downloadedThemeDirSuffix = "-downloaded"
stylesTemplatePlaceholder = "{{@ styles @}}"
pageHeadTemplatePlaceholder = "{{@ page-head @}}"
subTemplatePlaceholder = "{{@ sub-template @}}"
commandCleanupTargetContent = "content"
commandCleanupTargetThumbs = "thumbs"
commandCleanupTargetTags = "tags"
commandCleanupTargetTagIndex = "tag-index"
commandCleanupTargetArchive = "archive"
commandCleanupTargetSearch = "search"
commandServeOptionAdmin = "--admin"
commandServeOptionWatchReload = "--watch-reload"
commandThemeActionActivate = "activate"
commandThemeActionInstall = "install"
commandThemeActionUpdate = "update"
commandThemeActionRefresh = "refresh"
commandThemeActionDelete = "delete"
httpProtocol = "http://"
httpsProtocol = "https://"
websocketProtocol = "ws://"
websocketPath = "/--ws--"
websocketPingPeriod = 60 * time.Second
jsOpeningTag = "<script type='text/javascript'>"
jsClosingTag = "</script>"
styleOpeningTag = "<style>"
styleClosingTag = "</style>"
headClosingTag = "</head>"
bodyClosingTag = "</body>"
mainOpeningTag = "<main>"
mainClosingTag = "</main>"
)
var (
defaultThumbSizes = /* const */ []int{480, 960}
thumbImgFileNameRegexp = /* const */ regexp.MustCompile(`_(\d+)` + thumbImgFileSuffix)
imageFileExtensions = /* const */ []string{".jpg", ".jpeg", ".png", ".gif"}
thumbImageFileExtensions = /* const */ []string{".jpg", ".jpeg", ".png"}
videoFileExtensions = /* const */ []string{".mp4", ".mkv", ".mov"}
metaDataPlaceholderRegexp = /* const */ regexp.MustCompile(`---[\s\w-:"]*---`)
contentDirectivePlaceholderRegexp = /* const */ regexp.MustCompile(`{.*}`)
whitespacePlaceholderRegexp = /* const */ regexp.MustCompile(`\s+`)
includeTemplateFilePlaceholderRegexp = /* const */ regexp.MustCompile(`{{@\s*([\w-_]+\.html)\s*@}}`)
includeContentFilePlaceholderRegexp = /* const */ regexp.MustCompile(`{{#\s*([\w-_]+\.html)\s*#}}`)
contentLinkPlaceholderRegexp = /* const */ regexp.MustCompile(`{%\s*([\w-_]+):([\w-_]+)\s*%}`)
mediaPlaceholderRegexp = /* const */ regexp.MustCompile(`{media(\([\s\w=,]+\))?(:\s*([\w\s-_.,*]+))?}`)
embedMediaPlaceholderRegexp = /* const */ regexp.MustCompile(`{embed:\s*([^}]+)}`)
wrapPlaceholderRegexp = /* const */ regexp.MustCompile(`\{([\w-_.]+)(\([\s\w=,]+\))?(:\s*([\w\s-_.,*]+))?}([^{}]*){/}`)
hashTagRegex = /* const */ regexp.MustCompile(`#(\p{L}+[_-]*\p{L}*)`)
)