@farming-labs/astro-theme 0.2.13 → 0.2.15

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": "@farming-labs/astro-theme",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "Astro UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
5
5
  "keywords": [
6
6
  "astro",
@@ -119,8 +119,8 @@
119
119
  },
120
120
  "dependencies": {
121
121
  "sugar-high": "^0.9.5",
122
- "@farming-labs/docs": "0.2.13",
123
- "@farming-labs/astro": "0.2.13"
122
+ "@farming-labs/astro": "0.2.15",
123
+ "@farming-labs/docs": "0.2.15"
124
124
  },
125
125
  "peerDependencies": {
126
126
  "astro": ">=4.0.0"
@@ -141,7 +141,20 @@ const readingTimeValue =
141
141
  typeof data.readingTime === "number"
142
142
  ? Math.max(1, Math.ceil(data.readingTime))
143
143
  : null;
144
- const readingTimeLabel = readingTimeValue ? `${readingTimeValue} min read` : null;
144
+ const readingTimeConfig = config?.readingTime;
145
+ const readingTimeFormat =
146
+ data.readingTimeFormat === "short" || data.readingTimeFormat === "long"
147
+ ? data.readingTimeFormat
148
+ : readingTimeConfig &&
149
+ typeof readingTimeConfig === "object" &&
150
+ (readingTimeConfig as { format?: string }).format === "short"
151
+ ? "short"
152
+ : "long";
153
+ const readingTimeLabel = readingTimeValue
154
+ ? readingTimeFormat === "short"
155
+ ? `${readingTimeValue} min`
156
+ : `${readingTimeValue} min read`
157
+ : null;
145
158
  const showReadingTimeAbove = !!readingTimeLabel && showActionsAbove;
146
159
  const showReadingTimeBelow =
147
160
  !!readingTimeLabel &&