@sugarat/theme 0.5.3 → 0.5.5

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/node.d.ts CHANGED
@@ -423,7 +423,7 @@ declare namespace Theme {
423
423
  backToTop?: boolean | BackToTop;
424
424
  /**
425
425
  * oh-my-live2d 的 loadOml2d 方法的配置选项
426
- * 详见 https://oml2d.com/options/Options.html
426
+ * 详见 https://oml2d.hacxy.cn/api/interfaces/Options.html
427
427
  */
428
428
  oml2d?: Options;
429
429
  homeTags?: boolean | HomeTagsConfig;
@@ -440,7 +440,7 @@ declare namespace Theme {
440
440
  imageStyle?: ImageStyleConfig;
441
441
  groupIcon?: {
442
442
  customIcon: Record<string, string>;
443
- };
443
+ } | false;
444
444
  }
445
445
  type FormatShowDate = {
446
446
  /**
package/node.js CHANGED
@@ -41,7 +41,7 @@ module.exports = __toCommonJS(node_exports);
41
41
  // src/utils/node/mdPlugins.ts
42
42
  var import_module = require("module");
43
43
 
44
- // ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.5.0_@algolia+client-search@4.19.1_@types+node@20.6.3__hxsuj227nyqox5emdzcwg6gwva/node_modules/vitepress-plugin-tabs/dist/index.js
44
+ // ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.6.3_@algolia+client-search@5.20.0_@types+node@2_89d33a1149fc4afc3a4b1eeb07b93bba/node_modules/vitepress-plugin-tabs/dist/index.js
45
45
  var tabsMarker = "=tabs";
46
46
  var tabsMarkerLen = tabsMarker.length;
47
47
  var ruleBlockTabs = (state, startLine, endLine, silent) => {
@@ -289,7 +289,9 @@ function getMarkdownPlugins(cfg) {
289
289
  if (cfg?.timeline !== false) {
290
290
  markdownPlugin.push(import_vitepress_markdown_timeline.default);
291
291
  }
292
- markdownPlugin.push(import_vitepress_plugin_group_icons.groupIconMdPlugin);
292
+ if (cfg?.groupIcon !== false) {
293
+ markdownPlugin.push(import_vitepress_plugin_group_icons.groupIconMdPlugin);
294
+ }
293
295
  return markdownPlugin;
294
296
  }
295
297
  function taskCheckboxPlugin(ops) {
@@ -397,7 +399,7 @@ async function getArticleMeta(filepath, route, timeZone = defaultTimeZoneOffset,
397
399
  }
398
400
  const utcValue = timeZone >= 0 ? `+${timeZone}` : `${timeZone}`;
399
401
  const date = await (meta.date && /* @__PURE__ */ new Date(`${new Date(meta.date).toUTCString()}${utcValue}`) || (0, import_theme_shared2.getFileLastModifyTime)(filepath));
400
- meta.date = formatDate(date || /* @__PURE__ */ new Date());
402
+ meta.date = formatDate(date || /* @__PURE__ */ new Date(), "yyyy/MM/dd hh:mm:ss");
401
403
  meta.categories = typeof meta.categories === "string" ? [meta.categories] : meta.categories;
402
404
  meta.tags = typeof meta.tags === "string" ? [meta.tags] : meta.tags;
403
405
  meta.tag = [meta.tag || []].flat().concat([
@@ -566,9 +568,25 @@ function getVitePlugins(cfg = {}) {
566
568
  if (cfg?.popover) {
567
569
  plugins.push((0, import_vitepress_plugin_announcement.AnnouncementPlugin)(cfg.popover));
568
570
  }
569
- plugins.push((0, import_vitepress_plugin_group_icons2.groupIconVitePlugin)(cfg?.groupIcon));
571
+ if (cfg?.groupIcon !== false) {
572
+ plugins.push(patchGroupIconPlugin());
573
+ plugins.push((0, import_vitepress_plugin_group_icons2.groupIconVitePlugin)(cfg?.groupIcon));
574
+ }
570
575
  return plugins;
571
576
  }
577
+ function patchGroupIconPlugin() {
578
+ return {
579
+ name: "@sugarat/theme-plugin-patch-group-icon",
580
+ enforce: "pre",
581
+ transform(code, id) {
582
+ if (id.match(/[\/\\]theme[\/\\]index\.(ts|js)$/)) {
583
+ return `import 'virtual:group-icons.css'
584
+ ${code}`;
585
+ }
586
+ return code;
587
+ }
588
+ };
589
+ }
572
590
  function registerVitePlugins(vpCfg, plugins) {
573
591
  vpCfg.vite = {
574
592
  plugins,
package/node.mjs CHANGED
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  // src/utils/node/mdPlugins.ts
10
10
  import { createRequire } from "module";
11
11
 
12
- // ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.5.0_@algolia+client-search@4.19.1_@types+node@20.6.3__hxsuj227nyqox5emdzcwg6gwva/node_modules/vitepress-plugin-tabs/dist/index.js
12
+ // ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.6.3_@algolia+client-search@5.20.0_@types+node@2_89d33a1149fc4afc3a4b1eeb07b93bba/node_modules/vitepress-plugin-tabs/dist/index.js
13
13
  var tabsMarker = "=tabs";
14
14
  var tabsMarkerLen = tabsMarker.length;
15
15
  var ruleBlockTabs = (state, startLine, endLine, silent) => {
@@ -256,7 +256,9 @@ function getMarkdownPlugins(cfg) {
256
256
  if (cfg?.timeline !== false) {
257
257
  markdownPlugin.push(timeline);
258
258
  }
259
- markdownPlugin.push(groupIconMdPlugin);
259
+ if (cfg?.groupIcon !== false) {
260
+ markdownPlugin.push(groupIconMdPlugin);
261
+ }
260
262
  return markdownPlugin;
261
263
  }
262
264
  function taskCheckboxPlugin(ops) {
@@ -363,7 +365,7 @@ async function getArticleMeta(filepath, route, timeZone = defaultTimeZoneOffset,
363
365
  }
364
366
  const utcValue = timeZone >= 0 ? `+${timeZone}` : `${timeZone}`;
365
367
  const date = await (meta.date && /* @__PURE__ */ new Date(`${new Date(meta.date).toUTCString()}${utcValue}`) || getFileLastModifyTime(filepath));
366
- meta.date = formatDate(date || /* @__PURE__ */ new Date());
368
+ meta.date = formatDate(date || /* @__PURE__ */ new Date(), "yyyy/MM/dd hh:mm:ss");
367
369
  meta.categories = typeof meta.categories === "string" ? [meta.categories] : meta.categories;
368
370
  meta.tags = typeof meta.tags === "string" ? [meta.tags] : meta.tags;
369
371
  meta.tag = [meta.tag || []].flat().concat([
@@ -534,9 +536,25 @@ function getVitePlugins(cfg = {}) {
534
536
  if (cfg?.popover) {
535
537
  plugins.push(AnnouncementPlugin(cfg.popover));
536
538
  }
537
- plugins.push(groupIconVitePlugin(cfg?.groupIcon));
539
+ if (cfg?.groupIcon !== false) {
540
+ plugins.push(patchGroupIconPlugin());
541
+ plugins.push(groupIconVitePlugin(cfg?.groupIcon));
542
+ }
538
543
  return plugins;
539
544
  }
545
+ function patchGroupIconPlugin() {
546
+ return {
547
+ name: "@sugarat/theme-plugin-patch-group-icon",
548
+ enforce: "pre",
549
+ transform(code, id) {
550
+ if (id.match(/[\/\\]theme[\/\\]index\.(ts|js)$/)) {
551
+ return `import 'virtual:group-icons.css'
552
+ ${code}`;
553
+ }
554
+ return code;
555
+ }
556
+ };
557
+ }
540
558
  function registerVitePlugins(vpCfg, plugins) {
541
559
  vpCfg.vite = {
542
560
  plugins,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sugarat/theme",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
5
5
  "author": "sugar",
6
6
  "license": "MIT",
@@ -50,23 +50,23 @@
50
50
  "oh-my-live2d": "^0.19.3",
51
51
  "swiper": "^11.1.1",
52
52
  "vitepress-markdown-timeline": "^1.2.1",
53
- "vitepress-plugin-group-icons": "^1.2.4",
53
+ "vitepress-plugin-group-icons": "1.2.4",
54
54
  "vitepress-plugin-mermaid": "2.0.13",
55
55
  "vitepress-plugin-tabs": "0.2.0",
56
- "vitepress-plugin-announcement": "0.1.3",
57
- "vitepress-plugin-rss": "0.3.0",
58
- "@sugarat/theme-shared": "0.0.3",
59
- "vitepress-plugin-pagefind": "0.4.12"
56
+ "@sugarat/theme-shared": "0.0.5",
57
+ "vitepress-plugin-pagefind": "0.4.14",
58
+ "vitepress-plugin-announcement": "0.1.5",
59
+ "vitepress-plugin-rss": "0.3.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@element-plus/icons-vue": "^2.3.1",
63
63
  "artalk": "^2.8.5",
64
64
  "element-plus": "^2.7.2",
65
- "pagefind": "^1.2.0",
65
+ "pagefind": "^1.3.0",
66
66
  "sass": "^1.80.6",
67
67
  "typescript": "^5.4.5",
68
68
  "vite": "^5.4.9",
69
- "vitepress": "1.5.0",
69
+ "vitepress": "1.6.3",
70
70
  "vue": "^3.5.12",
71
71
  "vitepress-plugin-51la": "0.1.0"
72
72
  },
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { useElementSize, useElementVisibility, useWindowSize } from '@vueuse/core'
3
3
  import { computed, ref } from 'vue'
4
- import { Comment } from '@element-plus/icons-vue'
5
4
  import { useCommentConfig, useOpenCommentConfig } from '../composables/config/blog'
6
5
  import Icon from './Icon.vue'
7
6
 
@@ -38,7 +37,7 @@ const labelText = computed(() => {
38
37
  <div v-show="!commentIsVisible" class="comment-btn-wrapper">
39
38
  <span v-if="!mobileMinify && labelText" class="icon-wrapper-text" @click="handleScrollToComment">
40
39
  <Icon :size="20" :icon="commentConfig?.icon">
41
- <Comment />
40
+ <svg data-v-f0aeb853="" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 1024 1024"><path fill="currentColor" d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" /></svg>
42
41
  </Icon>
43
42
  <span class="text">
44
43
  {{ labelText }}
@@ -46,7 +45,7 @@ const labelText = computed(() => {
46
45
  </span>
47
46
  <span v-else class="icon-wrapper" @click="handleScrollToComment">
48
47
  <Icon :size="20" :icon="commentConfig?.icon">
49
- <Comment />
48
+ <svg data-v-f0aeb853="" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 1024 1024"><path fill="currentColor" d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" /></svg>
50
49
  </Icon>
51
50
  </span>
52
51
  </div>
@@ -213,11 +213,7 @@ function handleChooseTag(tag: string) {
213
213
  <!-- times -->
214
214
  <div class="times">
215
215
  <span class="icon">
216
- <svg
217
- xmlns="http://www.w3.org/2000/svg"
218
- xmlns:xlink="http://www.w3.org/1999/xlink"
219
- viewBox="0 0 24 24"
220
- >
216
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
221
217
  <title>上线时间</title>
222
218
  <path
223
219
  d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8s8 3.58 8 8s-3.58 8-8 8zm-.22-13h-.06c-.4 0-.72.32-.72.72v4.72c0 .35.18.68.49.86l4.15 2.49c.34.2.78.1.98-.24a.71.71 0 0 0-.25-.99l-3.87-2.3V7.72c0-.4-.32-.72-.72-.72z"
@@ -230,17 +226,10 @@ function handleChooseTag(tag: string) {
230
226
  </div>
231
227
  <!-- GitHub links -->
232
228
  <div v-if="work.github" class="links">
233
- <a
234
- v-if="work.github"
235
- class="github-link"
236
- :href="work.github as string"
237
- target="_blank"
238
- rel="noopener"
239
- >
229
+ <a v-if="work.github" class="github-link" :href="work.github as string" target="_blank" rel="noopener">
240
230
  <i class="icon">
241
231
  <svg
242
- xmlns="http://www.w3.org/2000/svg"
243
- xmlns:xlink="http://www.w3.org/1999/xlink"
232
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
244
233
  viewBox="0 0 496 512"
245
234
  >
246
235
  <path
@@ -255,35 +244,16 @@ function handleChooseTag(tag: string) {
255
244
  <!-- 其它自定义链接 -->
256
245
  <div v-if="work.links?.length" class="links">
257
246
  <i v-if="work.links?.length" class="icon">
258
- <svg
259
- xmlns="http://www.w3.org/2000/svg"
260
- xmlns:xlink="http://www.w3.org/1999/xlink"
261
- viewBox="0 0 24 24"
262
- >
263
- <g
264
- fill="none"
265
- stroke="currentColor"
266
- stroke-width="2"
267
- stroke-linecap="round"
268
- stroke-linejoin="round"
269
- >
270
- <path
271
- d="M10 14a3.5 3.5 0 0 0 5 0l4-4a3.5 3.5 0 0 0-5-5l-.5.5"
272
- />
273
- <path
274
- d="M14 10a3.5 3.5 0 0 0-5 0l-4 4a3.5 3.5 0 0 0 5 5l.5-.5"
275
- />
247
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
248
+ <g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
249
+ <path d="M10 14a3.5 3.5 0 0 0 5 0l4-4a3.5 3.5 0 0 0-5-5l-.5.5" />
250
+ <path d="M14 10a3.5 3.5 0 0 0-5 0l-4 4a3.5 3.5 0 0 0 5 5l.5-.5" />
276
251
  </g>
277
252
  </svg>
278
253
  </i>
279
254
  <a
280
- v-for="link in work.links || []"
281
- :key="link.url"
282
- class="link"
283
- :href="link.url"
284
- :title="link.title"
285
- target="_blank"
286
- rel="noopener"
255
+ v-for="link in work.links || []" :key="link.url" class="link" :href="link.url" :title="link.title"
256
+ target="_blank" rel="noopener"
287
257
  >
288
258
  {{ link.title }}
289
259
  </a>
@@ -291,23 +261,14 @@ function handleChooseTag(tag: string) {
291
261
  <!-- tags -->
292
262
  <div v-if="work.tags?.length" class="tags">
293
263
  <i class="icon">
294
- <svg
295
- xmlns="http://www.w3.org/2000/svg"
296
- viewBox="0 0 1024 1024"
297
- data-v-d328c40a=""
298
- >
264
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" data-v-d328c40a="">
299
265
  <path
300
266
  fill="currentColor"
301
267
  d="M256 128v698.88l196.032-156.864a96 96 0 0 1 119.936 0L768 826.816V128H256zm-32-64h576a32 32 0 0 1 32 32v797.44a32 32 0 0 1-51.968 24.96L531.968 720a32 32 0 0 0-39.936 0L243.968 918.4A32 32 0 0 1 192 893.44V96a32 32 0 0 1 32-32z"
302
268
  />
303
269
  </svg>
304
270
  </i>
305
- <span
306
- v-for="tag in work.tags"
307
- :key="tag"
308
- class="tag"
309
- @click="handleChooseTag(tag)"
310
- >{{ tag }}
271
+ <span v-for="tag in work.tags" :key="tag" class="tag" @click="handleChooseTag(tag)">{{ tag }}
311
272
  </span>
312
273
  </div>
313
274
  </div>
@@ -315,25 +276,11 @@ function handleChooseTag(tag: string) {
315
276
  <div v-if="work.covers?.length" class="images">
316
277
  <!-- swiper -->
317
278
  <div v-if="work.coverLayout === 'swiper'" class="swiper-mode">
318
- <ElCarousel
319
- autoplay
320
- height="260px"
321
- :type="isCardMode && work.covers.length >= 3 ? 'card' : ''"
322
- >
323
- <ElCarouselItem
324
- v-for="(url, idx) in work.covers"
325
- :key="url"
326
- style="text-align: center"
327
- >
279
+ <ElCarousel autoplay height="260px" :type="isCardMode && work.covers.length >= 3 ? 'card' : ''">
280
+ <ElCarouselItem v-for="(url, idx) in work.covers" :key="url" style="text-align: center">
328
281
  <ElImage
329
- :key="url"
330
- preview-teleported
331
- :src="url"
332
- loading="lazy"
333
- :preview-src-list="work.covers"
334
- :initial-index="idx"
335
- hide-on-click-modal
336
- :alt="`${work.title}-${idx}`"
282
+ :key="url" preview-teleported :src="url" loading="lazy" :preview-src-list="work.covers"
283
+ :initial-index="idx" hide-on-click-modal :alt="`${work.title}-${idx}`"
337
284
  />
338
285
  </ElCarouselItem>
339
286
  </ElCarousel>
@@ -341,13 +288,8 @@ function handleChooseTag(tag: string) {
341
288
  <!-- list -->
342
289
  <div v-if="work.coverLayout === 'list'" class="list-mode">
343
290
  <ElImage
344
- v-for="(url, idx) in work.covers"
345
- :key="url"
346
- :src="url"
347
- loading="lazy"
348
- :preview-src-list="work.covers"
349
- :initial-index="idx"
350
- hide-on-click-modal
291
+ v-for="(url, idx) in work.covers" :key="url" :src="url" loading="lazy"
292
+ :preview-src-list="work.covers" :initial-index="idx" hide-on-click-modal
351
293
  />
352
294
  </div>
353
295
  </div>
@@ -369,24 +311,29 @@ function handleChooseTag(tag: string) {
369
311
  width: 100%;
370
312
  margin: 20px auto;
371
313
  padding: 16px;
314
+
372
315
  h1 {
373
316
  font-size: 32px;
374
317
  font-weight: bold;
375
318
  }
319
+
376
320
  .description {
377
321
  margin-top: 16px;
378
322
  color: #999;
379
323
  font-size: 16px;
380
324
  }
325
+
381
326
  a {
382
327
  font-weight: 500;
383
328
  color: var(--vp-c-brand-1);
384
329
  }
385
330
  }
331
+
386
332
  .works-container {
387
333
  display: flex;
388
334
  justify-content: center;
389
335
  }
336
+
390
337
  .work {
391
338
  max-width: 900px;
392
339
 
@@ -396,9 +343,11 @@ function handleChooseTag(tag: string) {
396
343
  line-height: 32px;
397
344
  font-size: 24px;
398
345
  border-top: 1px solid var(--vp-c-divider);
346
+
399
347
  a {
400
348
  color: inherit;
401
349
  }
350
+
402
351
  &:hover {
403
352
  a {
404
353
  &::before {
@@ -406,8 +355,10 @@ function handleChooseTag(tag: string) {
406
355
  }
407
356
  }
408
357
  }
358
+
409
359
  a {
410
360
  position: relative;
361
+
411
362
  &::before {
412
363
  position: absolute;
413
364
  left: -16px;
@@ -416,37 +367,44 @@ function handleChooseTag(tag: string) {
416
367
  }
417
368
  }
418
369
  }
370
+
419
371
  h3 {
420
372
  margin: 32px 0 0;
421
373
  line-height: 28px;
422
374
  font-size: 20px;
423
375
  position: relative;
424
- &.title > a.pin {
376
+
377
+ &.title>a.pin {
425
378
  position: absolute;
426
379
  left: -16px;
380
+
427
381
  &::before {
428
382
  left: -16px;
429
383
  opacity: 0;
430
384
  content: var(--vp-header-anchor-symbol);
431
385
  }
432
386
  }
433
- &:hover > a.pin {
387
+
388
+ &:hover>a.pin {
434
389
  &::before {
435
390
  opacity: 1;
436
391
  }
437
392
  }
438
393
  }
394
+
439
395
  .info {
440
396
  display: flex;
441
397
  font-size: 14px;
442
398
  margin-top: 10px;
443
399
  flex-wrap: wrap;
444
400
  }
401
+
445
402
  .links,
446
403
  .times,
447
404
  .tags {
448
405
  display: flex;
449
406
  align-items: center;
407
+
450
408
  .icon {
451
409
  color: var(--vp-c-text-1);
452
410
  display: block;
@@ -455,34 +413,42 @@ function handleChooseTag(tag: string) {
455
413
  margin-right: 6px;
456
414
  }
457
415
  }
416
+
458
417
  .times {
459
418
  margin-right: 18px;
460
419
  }
420
+
461
421
  .links {
462
422
  a {
463
423
  display: flex;
464
424
  align-items: center;
465
425
  }
426
+
466
427
  a.github-link {
467
428
  margin-right: 10px;
468
429
  }
430
+
469
431
  a.link {
470
432
  margin-right: 0;
433
+
471
434
  &::after {
472
435
  content: ',';
473
436
  color: var(--vp-c-text-1);
474
437
  margin-right: 6px;
475
438
  margin-left: 2px;
476
439
  }
440
+
477
441
  &:last-child::after {
478
442
  content: '';
479
443
  }
480
444
  }
481
445
  }
446
+
482
447
  .tags {
483
448
  span.tag {
484
449
  cursor: pointer;
485
450
  }
451
+
486
452
  span.tag:not(:last-child) {
487
453
  &::after {
488
454
  content: '·';
@@ -492,6 +458,21 @@ function handleChooseTag(tag: string) {
492
458
  }
493
459
  }
494
460
  }
461
+ .works {
462
+ flex: 1;
463
+ }
464
+ @media (min-width: 1440px) {
465
+ .works {
466
+ max-width: 784px;
467
+ }
468
+ }
469
+
470
+ @media (min-width: 960px) {
471
+ .works {
472
+ max-width: 752px;
473
+ }
474
+ }
475
+
495
476
  .aside-container {
496
477
  display: none;
497
478
  flex: 1;
@@ -499,18 +480,18 @@ function handleChooseTag(tag: string) {
499
480
  width: 100%;
500
481
  max-width: 256px;
501
482
  }
483
+
502
484
  @media screen and (min-width: 960px) {
503
485
  .aside-container {
504
486
  display: block;
505
487
  }
506
488
  }
489
+
507
490
  .aside-outline-container {
508
491
  position: sticky;
509
- top: calc(
510
- var(--vp-nav-height) + var(--vp-layout-top-height, 0px) +
511
- var(--vp-doc-top-height, 0px) + 32px
512
- );
492
+ top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 32px);
513
493
  }
494
+
514
495
  .lastupdate {
515
496
  color: var(--vp-c-text-1);
516
497
  }
@@ -522,6 +503,7 @@ function handleChooseTag(tag: string) {
522
503
  display: flex;
523
504
  flex-wrap: wrap;
524
505
  justify-content: center;
506
+
525
507
  .el-image {
526
508
  :deep(img) {
527
509
  object-fit: contain;
@@ -532,6 +514,7 @@ function handleChooseTag(tag: string) {
532
514
 
533
515
  .swiper-mode {
534
516
  margin-top: 16px;
517
+
535
518
  .el-image {
536
519
  :deep(img) {
537
520
  object-fit: contain;
@@ -539,6 +522,7 @@ function handleChooseTag(tag: string) {
539
522
  }
540
523
  }
541
524
  }
525
+
542
526
  .split {
543
527
  display: inline-block;
544
528
  width: 1px;
@@ -450,7 +450,7 @@ export namespace Theme {
450
450
 
451
451
  /**
452
452
  * oh-my-live2d 的 loadOml2d 方法的配置选项
453
- * 详见 https://oml2d.com/options/Options.html
453
+ * 详见 https://oml2d.hacxy.cn/api/interfaces/Options.html
454
454
  */
455
455
  oml2d?: Oml2dOptions
456
456
  homeTags?: boolean | HomeTagsConfig
@@ -467,7 +467,7 @@ export namespace Theme {
467
467
  imageStyle?: ImageStyleConfig
468
468
  groupIcon?: {
469
469
  customIcon: Record<string, string>
470
- }
470
+ } | false
471
471
  }
472
472
 
473
473
  export type FormatShowDate = {
@@ -42,7 +42,7 @@ export function useOml2d() {
42
42
  const { loadOml2d } = await import('oh-my-live2d')
43
43
  loadOml2d({
44
44
  ...defaultOptions,
45
- ...oml2dOptions,
45
+ ...oml2dOptions?.value,
46
46
  models: oml2dOptions?.value?.models?.map(model => ({
47
47
  ...defaultModelOptions,
48
48
  ...model,
package/src/index.ts CHANGED
@@ -35,8 +35,8 @@ import UserWorksPage from './components/UserWorks.vue'
35
35
  // 内置一些特殊的主题色
36
36
  import './styles/theme/inline-theme.var.css'
37
37
 
38
- // 导入group icons
39
- import 'virtual:group-icons.css'
38
+ // 导入group icons,改由自定义插件导入
39
+ // import 'virtual:group-icons.css'
40
40
 
41
41
  export const BlogTheme: Theme = {
42
42
  ...DefaultTheme,
@@ -32,7 +32,9 @@ export function getMarkdownPlugins(cfg?: Partial<Theme.BlogConfig>) {
32
32
  markdownPlugin.push(timeline)
33
33
  }
34
34
 
35
- markdownPlugin.push(groupIconMdPlugin)
35
+ if (cfg?.groupIcon !== false) {
36
+ markdownPlugin.push(groupIconMdPlugin)
37
+ }
36
38
 
37
39
  return markdownPlugin
38
40
  }
@@ -47,7 +47,7 @@ export async function getArticleMeta(filepath: string, route: string, timeZone =
47
47
  || getFileLastModifyTime(filepath)
48
48
  )
49
49
  // 无法获取时兜底当前时间
50
- meta.date = formatDate(date || new Date())
50
+ meta.date = formatDate(date || new Date(), 'yyyy/MM/dd hh:mm:ss')
51
51
 
52
52
  // 处理tags和categories,兼容历史文章
53
53
  meta.categories
@@ -56,12 +56,29 @@ export function getVitePlugins(cfg: Partial<Theme.BlogConfig> = {}) {
56
56
  }
57
57
 
58
58
  // 内置支持 group icon
59
-
60
- plugins.push(groupIconVitePlugin(cfg?.groupIcon))
59
+ if (cfg?.groupIcon !== false) {
60
+ plugins.push(patchGroupIconPlugin())
61
+ plugins.push(groupIconVitePlugin(cfg?.groupIcon))
62
+ }
61
63
 
62
64
  return plugins
63
65
  }
64
66
 
67
+ export function patchGroupIconPlugin() {
68
+ return {
69
+ name: '@sugarat/theme-plugin-patch-group-icon',
70
+ enforce: 'pre',
71
+ transform(code: string, id: string) {
72
+ // 匹配 theme/index.ts 或 theme/index.js 文件
73
+ if (id.match(/[\/\\]theme[\/\\]index\.(ts|js)$/)) {
74
+ // 在文件顶部插入 import 语句
75
+ return `import 'virtual:group-icons.css'\n${code}`
76
+ }
77
+ return code
78
+ }
79
+ }
80
+ }
81
+
65
82
  export function registerVitePlugins(vpCfg: any, plugins: any[]) {
66
83
  vpCfg.vite = {
67
84
  plugins,