Open trueberryless opened 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
starlight-blog-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 11, 2024 9:17pm |
Deployment failed with the following error:
The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.
Okay, I'm sorry for the many commits (Vercel build minutes) HiDeoo, but I think I got the most features covered from #74
Some thinks to note down before merging:
there is currently the inconsistency that the reading time has a space between the number and string: 2 min
or 1 h
but when there are multiple numbers, like here: 1h 9min
I chose not to include the space because it looks weird for me, but this is something we need to discuss. I just saw that @julien-deramond just has the spaces in every case:
~there are currently NO TESTS written by me because 1. I'm not that familiar with writing test currently (Im working on it) and 2. I dont know how you, HiDeoo, want to handle the test scenarios. I looked into the test folder and wasn't sure if I should create a new file under /basics
or just some random test in utils
so I leave it up to you...~ I have written tests for the libs/readingTime.ts
the documentation is expandable (basics are covered but nothing too advanced)
when Starlight merges https://github.com/withastro/starlight/pull/2390 we'll probably have to revised all overridden components and see which we can avoid to override
Describe the pull request
Add reading time after discussion #74 was left open for 3 months.
How
new Starlight component override:
PageTitle.astro
add property to
config.ts
(showReadingTime
: generall set if readingTime should be calculated) and schema (readingTime
: manually override calculated readingTime or show specific readingTime ifshowReadingTime
is deactivated)additional libs file (
readingTime.ts
)change the
MarkdownContent.astro
andMetadata.astro
files and createPageTitle.astro
fileIf readingTime is too large it shows in hours and minutes
write tests for
libs/readingTime.ts
Screenshots
manual override: