Skip to content

Commit a34d541

Browse files
Merge branch 'main' into build/update-astro-paper
# Conflicts: # src/config.ts # src/content/blog/how-to-add-an-estimated-reading-time.md
2 parents fff3d45 + b3fd456 commit a34d541

10 files changed

Lines changed: 283 additions & 351 deletions

File tree

astro.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export default defineConfig({
1414
applyBaseStyles: false,
1515
}),
1616
react(),
17-
sitemap(),
17+
sitemap({
18+
filter: page => SITE.showArchives || !page.endsWith("/archives"),
19+
}),
1820
],
1921
markdown: {
2022
remarkPlugins: [

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@astrojs/check": "^0.9.3",
1818
"@astrojs/rss": "^4.0.7",
1919
"@resvg/resvg-js": "^2.6.2",
20-
"astro": "^4.16.3",
20+
"astro": "^4.16.18",
2121
"fuse.js": "^7.0.0",
2222
"lodash.kebabcase": "^4.1.1",
2323
"remark-collapse": "^0.1.2",

src/assets/socialIcons.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ const socialIcons = {
5555
<rect x="3" y="5" width="18" height="14" rx="2"></rect>
5656
<polyline points="3 7 12 13 21 7"></polyline>
5757
</svg>`,
58-
Twitter: `<svg
58+
X: `<svg
5959
xmlns="http://www.w3.org/2000/svg"
6060
class="icon-tabler"
6161
stroke-linecap="round"
6262
stroke-linejoin="round"
6363
>
64-
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
65-
<path d="M22 4.01c-1 .49 -1.98 .689 -3 .99c-1.121 -1.265 -2.783 -1.335 -4.38 -.737s-2.643 2.06 -2.62 3.737v1c-3.245 .083 -6.135 -1.395 -8 -4c0 0 -4.182 7.433 4 11c-1.872 1.247 -3.739 2.088 -6 2c3.308 1.803 6.913 2.423 10.034 1.517c3.58 -1.04 6.522 -3.723 7.651 -7.742a13.84 13.84 0 0 0 .497 -3.753c-.002 -.249 1.51 -2.772 1.818 -4.013z"></path>
64+
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
65+
<path d="M4 4l11.733 16h4.267l-11.733 -16z" /><path d="M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" />
6666
</svg>`,
6767
Twitch: `<svg
6868
xmlns="http://www.w3.org/2000/svg"

src/components/Search.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ export default function SearchBar({ searchList }: Props) {
7373
}
7474
}, [inputVal]);
7575

76+
useEffect(() => {
77+
// focus on text input when search bar is displayed
78+
if (inputRef.current) {
79+
inputRef.current.focus();
80+
}
81+
}, [inputVal]);
82+
7683
return (
7784
<>
7885
<label className="relative block">

src/components/ShareLinks.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const shareLinks = [
1616
linkTitle: `Share this post on Facebook`,
1717
},
1818
{
19-
name: "Twitter",
20-
href: "https://twitter.com/intent/tweet?url=",
21-
linkTitle: `Tweet this post`,
19+
name: "X",
20+
href: "https://x.com/intent/post?url=",
21+
linkTitle: `Share this post on X`,
2222
},
2323
{
2424
name: "Telegram",

src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export const SOCIALS: SocialObjects = [
4141
active: true,
4242
},
4343
{
44-
name: "Twitter",
45-
href: "https://twitter.com/fangxuanmiao",
46-
linkTitle: `${SITE.author} on Twitter`,
44+
name: "X",
45+
href: "https://x.com/fangxuanmiao",
46+
linkTitle: `${SITE.author} on X`,
4747
active: true,
4848
},
4949
{

src/layouts/PostDetails.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const nextPost =
7777
</button>
7878
</div>
7979
<main id="main-content">
80-
<h1 transition:name={slugifyStr(title)} class="post-title">{title}</h1>
80+
<h1 transition:name={slugifyStr(title)} class="post-title inline-block">{title}</h1>
8181
<Datetime
8282
pubDatetime={pubDatetime}
8383
modDatetime={modDatetime}

src/pages/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ I'm StephenFang, who like programming lovely mobile applications.
2929

3030
- Telegram [https://t.me/stephenfang](https://t.me/stephenfang)
3131
- LinkedIn [https://www.linkedin.com/in/stephen-fang-aa811a32/](https://www.linkedin.com/in/stephen-fang-aa811a32/)
32-
- Twitter [https://twitter.com/Fangxuanmiao](https://twitter.com/Fangxuanmiao)
32+
- X [https://x.com/Fangxuanmiao](https://x.com/Fangxuanmiao)
3333
- GitHub [https://github.com/iamStephenFang](https://github.com/iamStephenFang)
3434

3535
## 📁 Related Links

src/pages/archives/index.astro

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,19 @@ const MonthMap: Record<string, string> = {
5959
<sup class="text-xs">{monthGroup.length}</sup>
6060
</div>
6161
<ul>
62-
{monthGroup.map(({ data, slug }) => (
63-
<Card href={`/posts/${slug}`} frontmatter={data} />
64-
))}
62+
{monthGroup
63+
.sort(
64+
(a, b) =>
65+
Math.floor(
66+
new Date(b.data.pubDatetime).getTime() / 1000
67+
) -
68+
Math.floor(
69+
new Date(a.data.pubDatetime).getTime() / 1000
70+
)
71+
)
72+
.map(({ data, slug }) => (
73+
<Card href={`/posts/${slug}`} frontmatter={data} />
74+
))}
6575
</ul>
6676
</div>
6777
))}

0 commit comments

Comments
 (0)