@windcoder/astro-theme-orchid 0.4.6 → 0.4.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windcoder/astro-theme-orchid",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "清新简约的 Astro 博客主题,以 Integration 形式提供,支持版本化升级与组件覆盖",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -2914,24 +2914,24 @@ a.page-item:hover {
2914
2914
  background: var(--surface);
2915
2915
  }
2916
2916
 
2917
- /* 左右两栏:≥768px 正文列 + 侧栏列(对齐参考模板 md 断点),≤767px 单列堆叠 */
2917
+ /* 左右两栏:≥1025px 正文列 + 侧栏列(断点与 .home-layout 统一),≤1024px 单列堆叠。
2918
+ 容器不设 max-width,跟随 .shell(min(92vw, --page-width)),
2919
+ 保证文章页与首页左右布局的左栏/右栏宽度完全一致(§4.32 迭代) */
2918
2920
  .post-layout {
2919
2921
  display: grid;
2920
2922
  grid-template-columns: minmax(0, 1fr);
2921
- gap: 36px;
2923
+ gap: 32px;
2922
2924
  align-items: start;
2923
- max-width: 900px;
2924
- margin: 0 auto;
2925
2925
  }
2926
2926
  .post-main {
2927
2927
  /* min-width:0 防 nowrap 标题/代码撑破网格轨道 */
2928
2928
  min-width: 0;
2929
2929
  }
2930
- @media (min-width: 768px) {
2930
+ @media (min-width: 1025px) {
2931
2931
  .post-layout {
2932
2932
  grid-template-columns: minmax(0, 1fr) 280px;
2933
- /* §4.46 侧栏统一 280px(与首页一致),max-width 同步 +60px 保持正文阅读行宽不变(§4.32 迭代) */
2934
- max-width: 1180px;
2933
+ /* §4.46 对齐参考站 gap-4:桌面列距 16px(与 .home-layout 一致) */
2934
+ gap: 16px;
2935
2935
  }
2936
2936
  }
2937
2937
  .prose {
@@ -5341,6 +5341,9 @@ html.dark .friend-card:hover .friend-name {
5341
5341
  .home-layout {
5342
5342
  gap: 24px;
5343
5343
  }
5344
+ .post-layout {
5345
+ gap: 24px;
5346
+ }
5344
5347
  .back-top {
5345
5348
  right: 16px;
5346
5349
  bottom: 20px;
package/src/utils.ts CHANGED
@@ -81,10 +81,12 @@ export function hexToHsl(hex: string): { h: number; s: number; l: number } {
81
81
  };
82
82
  }
83
83
 
84
- /** 过滤草稿并排序:置顶优先,其余按发布时间倒序 */
84
+ /** 排序:置顶优先,其余按发布时间倒序;草稿过滤跟随环境(PROD 剪除,dev 放行以供预览,
85
+ * 与 14 处 getCollection 的 PROD/dev 分支同口径——否则 dev 下 getCollection 放行的草稿
86
+ * 会在此被二次剪除,导致分类/文章详情等 getStaticPaths 链路 404) */
85
87
  export function getSortedPosts<T extends PostLike>(posts: T[]): T[] {
86
88
  return posts
87
- .filter((p) => !p.data.draft)
89
+ .filter((p) => (import.meta.env.PROD ? !p.data.draft : true))
88
90
  .sort((a, b) => {
89
91
  if (a.data.pinned !== b.data.pinned) return a.data.pinned ? -1 : 1;
90
92
  return b.data.published.getTime() - a.data.published.getTime();