Skip to content

Commit 0ba1edf

Browse files
chore(deps-dev): bump starlight-blog from 0.23.2 to 0.24.0
1 parent bd167e5 commit 0ba1edf

4 files changed

Lines changed: 22 additions & 32 deletions

File tree

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default defineConfig({
5050
url: 'https://github.com/julien-deramond/',
5151
},
5252
},
53+
metrics: {
54+
readingTime: true,
55+
words: 'total',
56+
},
5357
recentPostCount: 5,
5458
postCount: Infinity,
5559
navigation: 'none',

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"preview": "astro preview",
1212
"start": "astro dev",
1313
"test": "vitest",
14-
"update:deps": "ncu -u -x starlight-blog",
14+
"update:deps": "ncu -u",
1515
"update:showcase": "tsx scripts/update-showcase.ts",
1616
"vercel": "vercel dev"
1717
},
@@ -36,7 +36,7 @@
3636
"prettier": "^3.5.3",
3737
"prettier-plugin-astro": "^0.14.1",
3838
"reading-time": "^1.5.0",
39-
"starlight-blog": "0.23.2",
39+
"starlight-blog": "^0.24.0",
4040
"starlight-links-validator": "^0.16.0",
4141
"starlight-showcases": "^0.3.0",
4242
"tsx": "^4.20.3",
Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,42 @@
11
---
22
import readingTime from 'reading-time';
3-
import { Icon } from '@astrojs/starlight/components';
43
import Default from '@astrojs/starlight/components/PageTitle.astro';
54
65
const { date } = Astro.locals.starlightRoute.entry.data;
76
const { entry, lang } = Astro.locals.starlightRoute;
87
98
const isGuide = Astro.locals.starlightRoute.id.startsWith('guide');
10-
const displayReadingTime =
11-
(isGuide && date) ||
12-
(Astro.locals.starlightRoute.id.startsWith('articles') &&
13-
!Astro.locals.starlightRoute.id.startsWith('articles/tags') &&
14-
!Astro.locals.starlightRoute.id.startsWith('articles/authors'));
9+
const displayReadingTime = isGuide && date;
1510
const displayDate = date && isGuide;
1611
---
1712

1813
<Default {...Astro.props}><slot /></Default>
1914

2015
{
2116
(displayDate || displayReadingTime) && (
22-
<div class="meta sl-flex">
23-
{displayReadingTime && (
24-
<span class="reading-time">
25-
<Icon name="seti:clock" />
26-
{Math.ceil(readingTime(entry.body || '').minutes)} min read
27-
</span>
28-
)}
17+
<div class="sl-text-sm sl-flex">
2918
{displayDate && (
3019
<p>
3120
<time datetime={date.toISOString()}>
3221
{date.toLocaleDateString(lang, { dateStyle: 'medium', timeZone: 'UTC' })}
3322
</time>
3423
</p>
3524
)}
25+
{displayReadingTime && (
26+
<span class="reading-time">&nbsp;-&nbsp;{Math.ceil(readingTime(entry.body || '').minutes)} min read</span>
27+
)}
3628
</div>
3729
)
3830
}
3931

4032
<style>
41-
.meta {
42-
gap: 0.75rem 3rem;
43-
justify-content: space-between;
44-
flex-wrap: wrap;
45-
font-size: var(--sl-text-sm);
46-
}
47-
4833
.reading-time {
4934
display: inline-flex;
5035
align-items: center;
36+
color: var(--sl-color-gray-3);
5137
}
5238

53-
.reading-time svg {
54-
margin-right: 0.5rem;
39+
.sl-text-sm {
40+
font-size: var(--sl-text-sm);
5541
}
5642
</style>

0 commit comments

Comments
 (0)