@anglefeint/astro-theme 0.1.38 → 0.1.39
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/package.json +1 -1
- package/src/i18n/messages.ts +18 -0
- package/src/layouts/BlogPost.astro +24 -7
package/package.json
CHANGED
package/src/i18n/messages.ts
CHANGED
|
@@ -48,6 +48,9 @@ export type Messages = {
|
|
|
48
48
|
metaUpdated: string;
|
|
49
49
|
metaReadMinutes: string;
|
|
50
50
|
systemStatusAria: string;
|
|
51
|
+
systemModelLabel: string;
|
|
52
|
+
systemModeLabel: string;
|
|
53
|
+
systemStateLabel: string;
|
|
51
54
|
promptContextLabel: string;
|
|
52
55
|
latencyLabel: string;
|
|
53
56
|
confidenceLabel: string;
|
|
@@ -116,6 +119,9 @@ export const DEFAULT_MESSAGES: Record<Locale, Messages> = {
|
|
|
116
119
|
metaUpdated: 'updated',
|
|
117
120
|
metaReadMinutes: 'min read',
|
|
118
121
|
systemStatusAria: 'Model status',
|
|
122
|
+
systemModelLabel: 'model',
|
|
123
|
+
systemModeLabel: 'mode',
|
|
124
|
+
systemStateLabel: 'state',
|
|
119
125
|
promptContextLabel: 'Context',
|
|
120
126
|
latencyLabel: 'latency est',
|
|
121
127
|
confidenceLabel: 'confidence',
|
|
@@ -182,6 +188,9 @@ export const DEFAULT_MESSAGES: Record<Locale, Messages> = {
|
|
|
182
188
|
metaUpdated: '更新',
|
|
183
189
|
metaReadMinutes: '分で読了',
|
|
184
190
|
systemStatusAria: 'モデル状態',
|
|
191
|
+
systemModelLabel: 'モデル',
|
|
192
|
+
systemModeLabel: 'モード',
|
|
193
|
+
systemStateLabel: '状態',
|
|
185
194
|
promptContextLabel: 'コンテキスト',
|
|
186
195
|
latencyLabel: '推定レイテンシ',
|
|
187
196
|
confidenceLabel: '信頼度',
|
|
@@ -248,6 +257,9 @@ export const DEFAULT_MESSAGES: Record<Locale, Messages> = {
|
|
|
248
257
|
metaUpdated: '수정',
|
|
249
258
|
metaReadMinutes: '분 읽기',
|
|
250
259
|
systemStatusAria: '모델 상태',
|
|
260
|
+
systemModelLabel: '모델',
|
|
261
|
+
systemModeLabel: '모드',
|
|
262
|
+
systemStateLabel: '상태',
|
|
251
263
|
promptContextLabel: '컨텍스트',
|
|
252
264
|
latencyLabel: '지연 추정',
|
|
253
265
|
confidenceLabel: '신뢰도',
|
|
@@ -315,6 +327,9 @@ export const DEFAULT_MESSAGES: Record<Locale, Messages> = {
|
|
|
315
327
|
metaUpdated: 'actualizado',
|
|
316
328
|
metaReadMinutes: 'min de lectura',
|
|
317
329
|
systemStatusAria: 'Estado del modelo',
|
|
330
|
+
systemModelLabel: 'modelo',
|
|
331
|
+
systemModeLabel: 'modo',
|
|
332
|
+
systemStateLabel: 'estado',
|
|
318
333
|
promptContextLabel: 'Contexto',
|
|
319
334
|
latencyLabel: 'latencia est',
|
|
320
335
|
confidenceLabel: 'confianza',
|
|
@@ -381,6 +396,9 @@ export const DEFAULT_MESSAGES: Record<Locale, Messages> = {
|
|
|
381
396
|
metaUpdated: '更新',
|
|
382
397
|
metaReadMinutes: '分钟阅读',
|
|
383
398
|
systemStatusAria: '模型状态',
|
|
399
|
+
systemModelLabel: '模型',
|
|
400
|
+
systemModeLabel: '模式',
|
|
401
|
+
systemStateLabel: '状态',
|
|
384
402
|
promptContextLabel: '语境',
|
|
385
403
|
latencyLabel: '延迟估计',
|
|
386
404
|
confidenceLabel: '置信度',
|
|
@@ -58,11 +58,16 @@ const hasStats = aiModel || wordCount !== undefined || tokenCount !== undefined;
|
|
|
58
58
|
const confidenceText = aiConfidence !== undefined ? aiConfidence.toFixed(2) : undefined;
|
|
59
59
|
const enableRedQueen = THEME.EFFECTS.ENABLE_RED_QUEEN;
|
|
60
60
|
const comments = THEME.COMMENTS;
|
|
61
|
+
const normalizedCommentTerm = comments.TERM.trim();
|
|
62
|
+
const normalizedCommentNumber = comments.NUMBER.trim();
|
|
63
|
+
const hasValidCommentNumber =
|
|
64
|
+
/^[1-9]\d*$/.test(normalizedCommentNumber) &&
|
|
65
|
+
Number.isSafeInteger(Number(normalizedCommentNumber));
|
|
61
66
|
const hasMappingParam =
|
|
62
67
|
comments.MAPPING === 'specific'
|
|
63
|
-
? Boolean(
|
|
68
|
+
? Boolean(normalizedCommentTerm)
|
|
64
69
|
: comments.MAPPING === 'number'
|
|
65
|
-
?
|
|
70
|
+
? hasValidCommentNumber
|
|
66
71
|
: true;
|
|
67
72
|
const hasCommentsConfig = Boolean(
|
|
68
73
|
comments.ENABLED &&
|
|
@@ -211,9 +216,21 @@ const hasCommentsConfig = Boolean(
|
|
|
211
216
|
{
|
|
212
217
|
hasSystemMeta && (
|
|
213
218
|
<div class="ai-system-row" aria-label={messages.blog.systemStatusAria}>
|
|
214
|
-
{aiModel &&
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
{aiModel && (
|
|
220
|
+
<span class="ai-system-chip">
|
|
221
|
+
{messages.blog.systemModelLabel}: {aiModel}
|
|
222
|
+
</span>
|
|
223
|
+
)}
|
|
224
|
+
{aiMode && (
|
|
225
|
+
<span class="ai-system-chip">
|
|
226
|
+
{messages.blog.systemModeLabel}: {aiMode}
|
|
227
|
+
</span>
|
|
228
|
+
)}
|
|
229
|
+
{aiState && (
|
|
230
|
+
<span class="ai-system-chip">
|
|
231
|
+
{messages.blog.systemStateLabel}: {aiState}
|
|
232
|
+
</span>
|
|
233
|
+
)}
|
|
217
234
|
</div>
|
|
218
235
|
)
|
|
219
236
|
}
|
|
@@ -325,8 +342,8 @@ const hasCommentsConfig = Boolean(
|
|
|
325
342
|
data-category={comments.CATEGORY}
|
|
326
343
|
data-category-id={comments.CATEGORY_ID}
|
|
327
344
|
data-mapping={comments.MAPPING}
|
|
328
|
-
data-term={comments.MAPPING === 'specific' ?
|
|
329
|
-
data-number={comments.MAPPING === 'number' ?
|
|
345
|
+
data-term={comments.MAPPING === 'specific' ? normalizedCommentTerm : undefined}
|
|
346
|
+
data-number={comments.MAPPING === 'number' ? normalizedCommentNumber : undefined}
|
|
330
347
|
data-strict={comments.STRICT}
|
|
331
348
|
data-reactions-enabled={comments.REACTIONS_ENABLED}
|
|
332
349
|
data-emit-metadata={comments.EMIT_METADATA}
|