forked from 88250/pipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetting.go
146 lines (117 loc) · 4.77 KB
/
setting.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Pipe - A small and beautiful blogging platform written in golang.
// Copyright (c) 2017-present, b3log.org
//
// Pipe is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
package model
// Setting model.
type Setting struct {
Model
Category string `sql:"index" gorm:"size:32" json:"category"`
Name string `sql:"index" gorm:"size:64" json:"name"`
Value string `gorm:"type:text" json:"value"`
BlogID uint64 `sql:"index" json:"blogID"`
}
// Setting names of category "system".
const (
SettingCategorySystem = "system"
SettingNameSystemVer = "systemVersion"
)
// Setting names of category "theme".
const (
SettingCategoryTheme = "theme"
SettingNameThemeName = "themeName"
)
// Setting names of category "basic".
const (
SettingCategoryBasic = "basic"
SettingNameBasicBlogURL = "basicBlogURL"
SettingNameBasicBlogSubtitle = "basicBlogSubtitle"
SettingNameBasicBlogTitle = "basicBlogTitle"
SettingNameBasicCommentable = "basicCommentable"
SettingNameBasicFooter = "basicFooter"
SettingNameBasicHeader = "basicHeader" // Removed from UI since v1.1.0
SettingNameBasicNoticeBoard = "basicNoticeBoard"
SettingNameBasicMetaDescription = "basicMetaDescription"
SettingNameBasicMetaKeywords = "basicMetaKeywords"
SettingNameBasicFaviconURL = "basicFaviconURL"
SettingNameBasicLogoURL = "basicLogoURL"
)
// Setting values of category "basic".
const (
SettingBasicFooterDefault = "<!-- 这里可用于放置备案信息等,支持 Markdown -->"
SettingBasicHeaderDefault = "<!-- 支持 Markdown -->"
SettingBasicBasicNoticeBoardDefault = "本博客由 [Pipe](https://github.com/88250/pipe) 强力驱动"
)
// Setting names of category "preference".
const (
SettingCategoryPreference = "preference"
SettingNamePreferenceArticleListPageSize = "preferenceArticleListPageSize"
SettingNamePreferenceArticleListWindowSize = "preferenceArticleListWindowSize"
SettingNamePreferenceArticleListStyle = "preferenceArticleListStyle"
SettingNamePreferenceMostCommentArticleListSize = "preferenceMostCommentArticleListSize"
SettingNamePreferenceMostUseTagListSize = "preferenceMostUseTagListSize"
SettingNamePreferenceMostViewArticleListSize = "preferenceMostViewArticleListSize"
SettingNamePreferenceRecentCommentListSize = "preferenceRecentCommentListSize"
SettingNamePreferenceRecommendArticleListSize = "preferenceRecommendArticleListSize"
)
// Setting values of category "preference".
const (
SettingPreferenceArticleListStyleValueTitle = 0
SettingPreferenceArticleListStyleValueTitleAbstract = 1
SettingPreferenceArticleListStyleValueTitleContent = 2
SettingPreferenceArticleListPageSizeDefault = 20
SettingPreferenceArticleListWindowSizeDefault = 7
SettingPreferenceArticleListStyleDefault = SettingPreferenceArticleListStyleValueTitleAbstract
SettingPreferenceMostCommentArticleListSizeDefault = 7
SettingPreferenceMostUseTagListSizeDefault = 15
SettingPreferenceMostViewArticleListSizeDefault = 15
SettingPreferenceRecentCommentListSizeDefault = 7
SettingPreferenceRecommendArticleListSizeDefault = 1
)
// Setting names of category "sign".
const (
SettingCategorySign = "sign"
SettingNameArticleSign = "signArticle"
)
// Setting values of category "sign".
const (
SettingArticleSignDefault = "<!-- 支持 Markdown;可用变量 {title}, {author}, {url} -->"
)
// Setting names of category "i18n".
const (
SettingCategoryI18n = "i18n"
SettingNameI18nLocale = "i18nLocale"
SettingNameI18nTimezone = "i18nTimezone"
)
// Setting names of category "feed".
const (
SettingCategoryFeed = "feed"
SettingNameFeedOutputMode = "feedOutputMode"
)
// Setting values of category "feed".
const (
SettingFeedOutputModeValueAbstract = 0
SettingFeedOutputModeValueFull = 1
)
// Setting names of category "thirdStatistic".
const (
SettingCategoryThirdStatistic = "thirdStatistic"
SettingNameThirdStatisticBaidu = "thirdStatisticBaidu"
)
// Setting names of category "statistic".
const (
SettingCategoryStatistic = "statistic"
SettingNameStatisticArticleCount = "statisticArticleCount"
SettingNameStatisticCommentCount = "statisticCommentCount"
SettingNameStatisticViewCount = "statisticViewCount"
)
// Setting names of category "ad".
const (
SettingCategoryAd = "ad"
SettingNameAdGoogleAdSenseArticleEmbed = "adGoogleAdSenseArticleEmbed"
)