Skip to content

Commit d2b8786

Browse files
committed
Add and clean up posts
1 parent 191bc9e commit d2b8786

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

packages/docs/mock/posts.json

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{
22
"data": [
3+
{
4+
"entities": {
5+
"urls": []
6+
},
7+
"id": "1932778410691949034",
8+
"author_id": "10",
9+
"created_at": "2025-06-11T14:34:00.000Z",
10+
"text": "\"Thanks Knip!\"\neveryday,\nevery team member,\nliterally..\nknip.dev 🏅"
11+
},
12+
{
13+
"entities": {
14+
"urls": []
15+
},
16+
"url": "https://github.com/webpro-nl/knip/issues/1120#issuecomment-2943978262",
17+
"author_id": "9",
18+
"created_at": "2025-06-05T14:00:00.000Z",
19+
"text": "Thank you so much for this incredible piece of software! Knip is one of the most impressive tools I've seen in my career."
20+
},
321
{
422
"entities": {
523
"urls": [
@@ -127,14 +145,6 @@
127145
{
128146
"entities": {
129147
"urls": [
130-
{
131-
"url": "https://t.co/JyMwFtAeGG",
132-
"expanded_url": "https://knip.dev",
133-
"display_url": "knip.dev",
134-
"title": "Knip",
135-
"description": "Project linter to find unused dependencies, exports and files in JavaScript and TypeScript projects",
136-
"unwound_url": "https://knip.dev"
137-
},
138148
{
139149
"url": "https://t.co/dummy-01",
140150
"display_url": "pic.twitter.com/uOuO1ch5ij",
@@ -146,7 +156,7 @@
146156
"author_id": "1",
147157
"created_at": "2024-01-13T01:55:00.000Z",
148158
"attachments": { "media_keys": ["1"] },
149-
"text": "warning: do not use a tool like https://t.co/JyMwFtAeGG + code search to delete a ton of unused code. It works too well.\n\nI just did this in https://github.com/sourcegraph/cody/pull/2705, and my boss said if I end the week with net negative lines of code committed, I'm in deep trouble. https://t.co/dummy-01"
159+
"text": "warning: do not use a tool like knip.dev + code search to delete a ton of unused code. It works too well.\n\nI just did this in https://github.com/sourcegraph/cody/pull/2705, and my boss said if I end the week with net negative lines of code committed, I'm in deep trouble. https://t.co/dummy-01"
150160
},
151161
{
152162
"entities": {
@@ -173,26 +183,6 @@
173183
}
174184
],
175185
"urls": [
176-
{
177-
"url": "https://t.co/JyMwFtAeGG",
178-
"expanded_url": "http://knip.dev",
179-
"display_url": "knip.dev",
180-
"images": [
181-
{
182-
"url": "https://pbs.twimg.com/news_img/1730151538373304320/3Nd8wXmH?format=jpg&name=orig",
183-
"width": 1200,
184-
"height": 630
185-
},
186-
{
187-
"url": "https://pbs.twimg.com/news_img/1730151538373304320/3Nd8wXmH?format=jpg&name=150x150",
188-
"width": 150,
189-
"height": 150
190-
}
191-
],
192-
"title": "Knip",
193-
"description": "Project linter to find unused dependencies, exports and files in JavaScript and TypeScript projects",
194-
"unwound_url": "https://knip.dev/"
195-
},
196186
{
197187
"url": "https://t.co/uOuO1ch5ij",
198188
"expanded_url": "https://twitter.com/gregberge_/status/1730180003453927560/photo/1",
@@ -202,7 +192,7 @@
202192
]
203193
},
204194
"author_id": "22918124",
205-
"text": "Ran https://t.co/JyMwFtAeGG in @argos_ci, and boom 💥! Dead code detected instantly. With a good config, it can run on CI to keep projects clean. Installing this tool should be a no-brainer, like Prettier or ESLint.\n\nKudos, @webprolific! 👏 https://t.co/uOuO1ch5ij",
195+
"text": "Ran knip.dev in @argos_ci, and boom 💥! Dead code detected instantly. With a good config, it can run on CI to keep projects clean. Installing this tool should be a no-brainer, like Prettier or ESLint.\n\nKudos, @webprolific! 👏 https://t.co/uOuO1ch5ij",
206196

207197
"id": "1730180003453927560",
208198
"created_at": "2023-11-30T11:00:32.000Z",
@@ -707,6 +697,18 @@
707697
"profile_image_url": "https://cdn.bsky.app/img/avatar/plain/did:plc:opw3iapscc55nlgrx6q2yjah/bafkreiaj72657msogojjdk4wr76fe3umimydon3pzzrquuj7opcftntrqa@jpeg",
708698
"name": "Nicolas Beaussart"
709699
},
700+
{
701+
"id": "9",
702+
"username": "MidnightDesign",
703+
"name": "Rudolph Gottesheim",
704+
"profile_image_url": "https://avatars.githubusercontent.com/u/743172?v=4"
705+
},
706+
{
707+
"id": "10",
708+
"username": "stephaneledorze",
709+
"name": "stephane le dorze",
710+
"profile_image_url": "https://pbs.twimg.com/profile_images/1587561006317899777/y8cgxyI7_400x400.jpg"
711+
},
710712
{
711713
"id": "22918124",
712714
"username": "gregberge_",

packages/docs/src/components/Post.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const post: PostWithUser = replaceShortenedUrls(Astro.props.data);
6060
<p class="text" set:html={post.text.trim().replace(/\n/g, '<br />')} />
6161
<p class="timestamp">
6262
<a
63-
href={`${post.id.length > 17 ? `https://twitter.com/${post.user.username}/status/${post.id}` : `https://bsky.app/profile/${post.user.username}/post/${post.id}`}`}>
63+
href={`${post.url ? post.url : post.id.length > 17 ? `https://twitter.com/${post.user.username}/status/${post.id}` : `https://bsky.app/profile/${post.user.username}/post/${post.id}`}`}>
6464
{formatTimestamp(post.created_at)}
6565
</a>
6666
</p>

packages/docs/src/util/post.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ interface Post {
6161
text: string;
6262
};
6363
id: string;
64+
url?: string;
6465
edit_history_tweet_ids: string[];
6566
created_at: string;
6667
}

0 commit comments

Comments
 (0)