@jant/core 0.2.17 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +1 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +319 -115
- package/dist/i18n/context.d.ts +2 -2
- package/dist/i18n/context.js +1 -1
- package/dist/i18n/i18n.d.ts +1 -1
- package/dist/i18n/i18n.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/i18n/locales/zh-Hant.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hant.js +1 -1
- package/dist/lib/config.d.ts +44 -10
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +69 -44
- package/dist/lib/constants.d.ts +2 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +5 -2
- package/dist/lib/sse.d.ts +15 -0
- package/dist/lib/sse.d.ts.map +1 -1
- package/dist/lib/sse.js +13 -0
- package/dist/lib/theme.d.ts +44 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +65 -0
- package/dist/routes/dash/appearance.d.ts +13 -0
- package/dist/routes/dash/appearance.d.ts.map +1 -0
- package/dist/routes/dash/appearance.js +164 -0
- package/dist/routes/dash/settings.d.ts.map +1 -1
- package/dist/routes/dash/settings.js +38 -37
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.d.ts.map +1 -1
- package/dist/services/settings.js +3 -0
- package/dist/theme/color-themes.d.ts +30 -0
- package/dist/theme/color-themes.d.ts.map +1 -0
- package/dist/theme/color-themes.js +268 -0
- package/dist/theme/layouts/BaseLayout.d.ts +5 -0
- package/dist/theme/layouts/BaseLayout.d.ts.map +1 -1
- package/dist/theme/layouts/BaseLayout.js +70 -3
- package/dist/theme/layouts/DashLayout.d.ts +2 -0
- package/dist/theme/layouts/DashLayout.d.ts.map +1 -1
- package/dist/theme/layouts/DashLayout.js +10 -1
- package/dist/theme/layouts/index.d.ts +1 -1
- package/dist/theme/layouts/index.d.ts.map +1 -1
- package/dist/types.d.ts +53 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +52 -0
- package/package.json +1 -1
- package/src/app.tsx +272 -55
- package/src/db/migrations/{0000_solid_moon_knight.sql → 0000_square_wallflower.sql} +3 -3
- package/src/db/migrations/meta/0000_snapshot.json +9 -9
- package/src/db/migrations/meta/_journal.json +2 -30
- package/src/i18n/context.tsx +2 -2
- package/src/i18n/i18n.ts +1 -1
- package/src/i18n/index.ts +1 -1
- package/src/i18n/locales/en.po +328 -252
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/zh-Hans.po +315 -278
- package/src/i18n/locales/zh-Hans.ts +1 -1
- package/src/i18n/locales/zh-Hant.po +315 -278
- package/src/i18n/locales/zh-Hant.ts +1 -1
- package/src/lib/config.ts +73 -47
- package/src/lib/constants.ts +3 -0
- package/src/lib/sse.ts +38 -0
- package/src/lib/theme.ts +86 -0
- package/src/preset.css +9 -0
- package/src/routes/dash/appearance.tsx +180 -0
- package/src/routes/dash/settings.tsx +50 -52
- package/src/services/settings.ts +5 -0
- package/src/styles/components.css +93 -0
- package/src/theme/color-themes.ts +321 -0
- package/src/theme/layouts/BaseLayout.tsx +61 -1
- package/src/theme/layouts/DashLayout.tsx +13 -2
- package/src/theme/layouts/index.ts +5 -1
- package/src/types.ts +62 -1
- package/src/db/migrations/0001_add_search_fts.sql +0 -40
- package/src/db/migrations/0002_collection_path.sql +0 -2
- package/src/db/migrations/0003_collection_path_nullable.sql +0 -21
- package/src/db/migrations/0004_media_uuid.sql +0 -35
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { FC, PropsWithChildren } from "hono/jsx";
|
|
10
10
|
import type { Context } from "hono";
|
|
11
|
+
export interface ToastProps {
|
|
12
|
+
message: string;
|
|
13
|
+
type?: "success" | "error";
|
|
14
|
+
}
|
|
11
15
|
export interface BaseLayoutProps {
|
|
12
16
|
title: string;
|
|
13
17
|
description?: string;
|
|
14
18
|
lang?: string;
|
|
15
19
|
c?: Context;
|
|
20
|
+
toast?: ToastProps;
|
|
16
21
|
}
|
|
17
22
|
export declare const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>>;
|
|
18
23
|
//# sourceMappingURL=BaseLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/BaseLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/BaseLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAiF7D,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
9
9
|
import { Script, Link, ViteClient } from "vite-ssr-components/hono";
|
|
10
10
|
import { I18nProvider } from "../../i18n/index.js";
|
|
11
|
-
export const BaseLayout = ({ title, description, lang, c, children })=>{
|
|
11
|
+
export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
12
12
|
// Read lang from Hono context if available, otherwise use prop or default
|
|
13
13
|
const resolvedLang = lang ?? (c ? c.get("lang") : "en");
|
|
14
14
|
// Automatically wrap with I18nProvider if Context is provided
|
|
@@ -16,6 +16,8 @@ export const BaseLayout = ({ title, description, lang, c, children })=>{
|
|
|
16
16
|
c: c,
|
|
17
17
|
children: children
|
|
18
18
|
}) : children;
|
|
19
|
+
// Read theme style from Hono context if available
|
|
20
|
+
const themeStyle = c ? c.get("themeStyle") : undefined;
|
|
19
21
|
return /*#__PURE__*/ _jsxs("html", {
|
|
20
22
|
lang: resolvedLang,
|
|
21
23
|
children: [
|
|
@@ -40,14 +42,79 @@ export const BaseLayout = ({ title, description, lang, c, children })=>{
|
|
|
40
42
|
href: "/src/style.css",
|
|
41
43
|
rel: "stylesheet"
|
|
42
44
|
}),
|
|
45
|
+
themeStyle && /*#__PURE__*/ _jsx("style", {
|
|
46
|
+
children: themeStyle
|
|
47
|
+
}),
|
|
43
48
|
/*#__PURE__*/ _jsx(Script, {
|
|
44
49
|
src: "/src/client.ts"
|
|
45
50
|
})
|
|
46
51
|
]
|
|
47
52
|
}),
|
|
48
|
-
/*#__PURE__*/
|
|
53
|
+
/*#__PURE__*/ _jsxs("body", {
|
|
49
54
|
class: "bg-background text-foreground antialiased",
|
|
50
|
-
children:
|
|
55
|
+
children: [
|
|
56
|
+
content,
|
|
57
|
+
/*#__PURE__*/ _jsx("div", {
|
|
58
|
+
id: "toast-container",
|
|
59
|
+
class: "toast-container",
|
|
60
|
+
children: toast && /*#__PURE__*/ _jsxs("div", {
|
|
61
|
+
class: `toast ${toast.type === "error" ? "toast-error" : "toast-success"}`,
|
|
62
|
+
"data-init": "history.replaceState({}, '', location.pathname); setTimeout(() => { el.classList.add('toast-out'); el.addEventListener('animationend', () => el.remove()) }, 3000)",
|
|
63
|
+
children: [
|
|
64
|
+
toast.type === "error" ? /*#__PURE__*/ _jsxs("svg", {
|
|
65
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
66
|
+
fill: "none",
|
|
67
|
+
viewBox: "0 0 24 24",
|
|
68
|
+
"stroke-width": "2",
|
|
69
|
+
stroke: "currentColor",
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
72
|
+
cx: "12",
|
|
73
|
+
cy: "12",
|
|
74
|
+
r: "10"
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ _jsx("path", {
|
|
77
|
+
d: "m15 9-6 6M9 9l6 6"
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}) : /*#__PURE__*/ _jsxs("svg", {
|
|
81
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
82
|
+
fill: "none",
|
|
83
|
+
viewBox: "0 0 24 24",
|
|
84
|
+
"stroke-width": "2",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
children: [
|
|
87
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
88
|
+
cx: "12",
|
|
89
|
+
cy: "12",
|
|
90
|
+
r: "10"
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ _jsx("path", {
|
|
93
|
+
d: "m9 12 2 2 4-4"
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsx("span", {
|
|
98
|
+
children: toast.message
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ _jsx("button", {
|
|
101
|
+
class: "toast-close",
|
|
102
|
+
"data-on:click": "el.closest('.toast').classList.add('toast-out'); el.closest('.toast').addEventListener('animationend', () => el.closest('.toast').remove())",
|
|
103
|
+
children: /*#__PURE__*/ _jsx("svg", {
|
|
104
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
105
|
+
fill: "none",
|
|
106
|
+
viewBox: "0 0 24 24",
|
|
107
|
+
"stroke-width": "2",
|
|
108
|
+
stroke: "currentColor",
|
|
109
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
110
|
+
d: "M18 6 6 18M6 6l12 12"
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
]
|
|
51
118
|
})
|
|
52
119
|
]
|
|
53
120
|
});
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { FC, PropsWithChildren } from "hono/jsx";
|
|
7
7
|
import type { Context } from "hono";
|
|
8
|
+
import { type ToastProps } from "./BaseLayout.js";
|
|
8
9
|
export interface DashLayoutProps {
|
|
9
10
|
c: Context;
|
|
10
11
|
title: string;
|
|
11
12
|
siteName: string;
|
|
12
13
|
currentPath?: string;
|
|
14
|
+
toast?: ToastProps;
|
|
13
15
|
}
|
|
14
16
|
export declare const DashLayout: FC<PropsWithChildren<DashLayoutProps>>;
|
|
15
17
|
//# sourceMappingURL=DashLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/DashLayout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DashLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/DashLayout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,OAAO,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AA2ID,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAe7D,CAAC"}
|
|
@@ -113,6 +113,14 @@ function DashLayoutContent({ siteName, currentPath, children }) {
|
|
|
113
113
|
id: "Tz0i8g",
|
|
114
114
|
message: "Settings"
|
|
115
115
|
})
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ _jsx("a", {
|
|
118
|
+
href: "/dash/appearance",
|
|
119
|
+
class: navClass("/dash/appearance", /^\/dash\/appearance/),
|
|
120
|
+
children: $__i18n._({
|
|
121
|
+
id: "aAIQg2",
|
|
122
|
+
message: "Appearance"
|
|
123
|
+
})
|
|
116
124
|
})
|
|
117
125
|
]
|
|
118
126
|
})
|
|
@@ -126,10 +134,11 @@ function DashLayoutContent({ siteName, currentPath, children }) {
|
|
|
126
134
|
]
|
|
127
135
|
});
|
|
128
136
|
}
|
|
129
|
-
export const DashLayout = ({ c, title, siteName, currentPath, children })=>{
|
|
137
|
+
export const DashLayout = ({ c, title, siteName, currentPath, toast, children })=>{
|
|
130
138
|
return /*#__PURE__*/ _jsx(BaseLayout, {
|
|
131
139
|
title: `${title} - ${siteName}`,
|
|
132
140
|
c: c,
|
|
141
|
+
toast: toast,
|
|
133
142
|
children: /*#__PURE__*/ _jsx(DashLayoutContent, {
|
|
134
143
|
siteName: siteName,
|
|
135
144
|
currentPath: currentPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -18,6 +18,55 @@ export interface Bindings {
|
|
|
18
18
|
SITE_DESCRIPTION?: string;
|
|
19
19
|
SITE_LANGUAGE?: string;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Configuration Registry - Single Source of Truth
|
|
23
|
+
*
|
|
24
|
+
* All available configuration fields with their metadata.
|
|
25
|
+
* Add new fields here, and they'll automatically work everywhere.
|
|
26
|
+
*
|
|
27
|
+
* Priority logic:
|
|
28
|
+
* - envOnly: false → User-configurable (DB > ENV > Default)
|
|
29
|
+
* - envOnly: true → Environment-only (ENV > Default)
|
|
30
|
+
*/
|
|
31
|
+
export declare const CONFIG_FIELDS: {
|
|
32
|
+
readonly SITE_NAME: {
|
|
33
|
+
readonly defaultValue: "Jant";
|
|
34
|
+
readonly envOnly: false;
|
|
35
|
+
};
|
|
36
|
+
readonly SITE_DESCRIPTION: {
|
|
37
|
+
readonly defaultValue: "A microblog powered by Jant";
|
|
38
|
+
readonly envOnly: false;
|
|
39
|
+
};
|
|
40
|
+
readonly SITE_LANGUAGE: {
|
|
41
|
+
readonly defaultValue: "en";
|
|
42
|
+
readonly envOnly: false;
|
|
43
|
+
};
|
|
44
|
+
readonly SITE_URL: {
|
|
45
|
+
readonly defaultValue: "";
|
|
46
|
+
readonly envOnly: true;
|
|
47
|
+
};
|
|
48
|
+
readonly AUTH_SECRET: {
|
|
49
|
+
readonly defaultValue: "";
|
|
50
|
+
readonly envOnly: true;
|
|
51
|
+
};
|
|
52
|
+
readonly R2_PUBLIC_URL: {
|
|
53
|
+
readonly defaultValue: "";
|
|
54
|
+
readonly envOnly: true;
|
|
55
|
+
};
|
|
56
|
+
readonly IMAGE_TRANSFORM_URL: {
|
|
57
|
+
readonly defaultValue: "";
|
|
58
|
+
readonly envOnly: true;
|
|
59
|
+
};
|
|
60
|
+
readonly DEMO_EMAIL: {
|
|
61
|
+
readonly defaultValue: "";
|
|
62
|
+
readonly envOnly: true;
|
|
63
|
+
};
|
|
64
|
+
readonly DEMO_PASSWORD: {
|
|
65
|
+
readonly defaultValue: "";
|
|
66
|
+
readonly envOnly: true;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type ConfigKey = keyof typeof CONFIG_FIELDS;
|
|
21
70
|
export interface Post {
|
|
22
71
|
id: number;
|
|
23
72
|
type: PostType;
|
|
@@ -96,6 +145,7 @@ export interface UpdatePost {
|
|
|
96
145
|
publishedAt?: number;
|
|
97
146
|
}
|
|
98
147
|
import type { FC, PropsWithChildren } from "hono/jsx";
|
|
148
|
+
import type { ColorTheme } from "./theme/color-themes.js";
|
|
99
149
|
/**
|
|
100
150
|
* Props for overridable theme components
|
|
101
151
|
*/
|
|
@@ -141,8 +191,10 @@ export interface JantTheme {
|
|
|
141
191
|
name?: string;
|
|
142
192
|
/** Component overrides */
|
|
143
193
|
components?: ThemeComponents;
|
|
144
|
-
/** CSS variable overrides */
|
|
194
|
+
/** CSS variable overrides (highest priority, always applied) */
|
|
145
195
|
cssVariables?: Record<string, string>;
|
|
196
|
+
/** Replace built-in color themes with a custom list */
|
|
197
|
+
colorThemes?: ColorTheme[];
|
|
146
198
|
}
|
|
147
199
|
/**
|
|
148
200
|
* Main Jant configuration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AM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,uDAAuD;IACvD,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
package/dist/types.js
CHANGED
|
@@ -17,3 +17,55 @@ export const VISIBILITY_LEVELS = [
|
|
|
17
17
|
"unlisted",
|
|
18
18
|
"draft"
|
|
19
19
|
];
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// Configuration System
|
|
22
|
+
// =============================================================================
|
|
23
|
+
/**
|
|
24
|
+
* Configuration Registry - Single Source of Truth
|
|
25
|
+
*
|
|
26
|
+
* All available configuration fields with their metadata.
|
|
27
|
+
* Add new fields here, and they'll automatically work everywhere.
|
|
28
|
+
*
|
|
29
|
+
* Priority logic:
|
|
30
|
+
* - envOnly: false → User-configurable (DB > ENV > Default)
|
|
31
|
+
* - envOnly: true → Environment-only (ENV > Default)
|
|
32
|
+
*/ export const CONFIG_FIELDS = {
|
|
33
|
+
// User-configurable (can be modified in dashboard)
|
|
34
|
+
SITE_NAME: {
|
|
35
|
+
defaultValue: "Jant",
|
|
36
|
+
envOnly: false
|
|
37
|
+
},
|
|
38
|
+
SITE_DESCRIPTION: {
|
|
39
|
+
defaultValue: "A microblog powered by Jant",
|
|
40
|
+
envOnly: false
|
|
41
|
+
},
|
|
42
|
+
SITE_LANGUAGE: {
|
|
43
|
+
defaultValue: "en",
|
|
44
|
+
envOnly: false
|
|
45
|
+
},
|
|
46
|
+
// Environment-only (deployment/infrastructure config)
|
|
47
|
+
SITE_URL: {
|
|
48
|
+
defaultValue: "",
|
|
49
|
+
envOnly: true
|
|
50
|
+
},
|
|
51
|
+
AUTH_SECRET: {
|
|
52
|
+
defaultValue: "",
|
|
53
|
+
envOnly: true
|
|
54
|
+
},
|
|
55
|
+
R2_PUBLIC_URL: {
|
|
56
|
+
defaultValue: "",
|
|
57
|
+
envOnly: true
|
|
58
|
+
},
|
|
59
|
+
IMAGE_TRANSFORM_URL: {
|
|
60
|
+
defaultValue: "",
|
|
61
|
+
envOnly: true
|
|
62
|
+
},
|
|
63
|
+
DEMO_EMAIL: {
|
|
64
|
+
defaultValue: "",
|
|
65
|
+
envOnly: true
|
|
66
|
+
},
|
|
67
|
+
DEMO_PASSWORD: {
|
|
68
|
+
defaultValue: "",
|
|
69
|
+
envOnly: true
|
|
70
|
+
}
|
|
71
|
+
};
|