Skip to content

Commit ea22289

Browse files
committed
Merge branch 'main' of github.com:yueim/astro-paper
2 parents cebc749 + 54c5ba7 commit ea22289

20 files changed

Lines changed: 543 additions & 341 deletions

astro.config.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from "astro/config";
1+
import { defineConfig, envField } from "astro/config";
22
import tailwindcss from "@tailwindcss/vite";
33
import sitemap from "@astrojs/sitemap";
44
import remarkToc from "remark-toc";
@@ -30,10 +30,18 @@ export default defineConfig({
3030
image: {
3131
// Used for all Markdown images; not configurable per-image
3232
// Used for all `<Image />` and `<Picture />` components unless overridden with a prop
33-
experimentalLayout: "responsive",
33+
experimentalLayout: "constrained",
34+
},
35+
env: {
36+
schema: {
37+
PUBLIC_GOOGLE_SITE_VERIFICATION: envField.string({
38+
access: "public",
39+
context: "client",
40+
optional: true,
41+
}),
42+
},
3443
},
3544
experimental: {
36-
svg: true,
3745
responsiveImages: true,
3846
preserveScriptOrder: true,
3947
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"lint": "eslint ."
1515
},
1616
"dependencies": {
17-
"@astrojs/rss": "^4.0.11",
18-
"@astrojs/sitemap": "^3.2.1",
17+
"@astrojs/rss": "^4.0.12",
18+
"@astrojs/sitemap": "^3.4.1",
1919
"@resvg/resvg-js": "^2.6.2",
2020
"@tailwindcss/vite": "^4.0.14",
21-
"astro": "^5.5.2",
21+
"astro": "^5.9.1",
2222
"dayjs": "^1.11.13",
2323
"lodash.kebabcase": "^4.1.1",
2424
"remark-collapse": "^0.1.2",

pnpm-lock.yaml

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

public/toggle-theme.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ window.onload = () => {
6767
document.addEventListener("astro:after-swap", setThemeFeature);
6868
};
6969

70+
// Set theme-color value before page transition
71+
// to avoid navigation bar color flickering in Android dark mode
72+
document.addEventListener("astro:before-swap", event => {
73+
const bgColor = document
74+
.querySelector("meta[name='theme-color']")
75+
?.getAttribute("content");
76+
77+
event.newDocument
78+
.querySelector("meta[name='theme-color']")
79+
?.setAttribute("content", bgColor);
80+
});
81+
7082
// sync with system changes
7183
window
7284
.matchMedia("(prefers-color-scheme: dark)")
Lines changed: 1 addition & 0 deletions
Loading

src/components/BackButton.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SITE } from "@/config";
66

77
{
88
SITE.showBackButton && (
9-
<div class="mx-auto flex w-full max-w-3xl items-center justify-start px-2">
9+
<div class="mx-auto flex w-full max-w-app items-center justify-start px-2">
1010
<LinkButton
1111
id="back-button"
1212
href="/"

src/components/BackToTopButton.astro

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
11
---
22
import IconChevronLeft from "@/assets/icons/IconChevronLeft.svg";
3-
4-
/*
5-
In #btt-btn-container, left position is `left-[calc((var(--container-3xl)/2)+50%+1rem)]`.
6-
This is because we use `max-w-3xl` in `PostDetails.astro`.
7-
If `max-width` in `PostDetails.astro` get updated, make sure to update the `var(--container-3xl)` as well.
8-
max-w-3xl => var(--container-3xl)
9-
max-w-4xl => var(--container-4xl)
10-
max-w-5xl => var(--container-5xl)
11-
etc...
12-
*/
3+
import IconArrowNarrowUp from "@/assets/icons/IconArrowNarrowUp.svg";
134
---
145

156
<div
167
id="btt-btn-container"
178
class:list={[
18-
"fixed right-4 bottom-8 xl:right-auto xl:left-[calc((var(--container-3xl)/2)+50%+1rem)]",
19-
"translate-y-14 opacity-0 transition-all duration-500",
9+
"fixed right-4 bottom-8 z-50",
10+
"md:sticky md:right-auto md:float-end md:mr-1",
11+
"translate-y-14 opacity-0 transition duration-500",
2012
]}
2113
>
2214
<button
2315
data-button="back-to-top"
2416
class:list={[
25-
"group relative",
26-
"size-14 rounded-full px-2 py-1 shadow-xl lg:h-8 lg:w-fit lg:rounded-md lg:shadow-none",
27-
"bg-background lg:bg-transparent",
17+
"group relative bg-background px-2 py-1",
18+
"size-14 rounded-full shadow-xl",
19+
"md:h-8 md:w-fit md:rounded-md md:shadow-none",
20+
"md:bg-background/35 md:bg-clip-padding md:backdrop-blur-lg",
2821
]}
2922
>
3023
<span
3124
id="progress-indicator"
32-
class="absolute inset-0 -z-10 block size-14 scale-110 rounded-full bg-transparent lg:hidden lg:h-8 lg:rounded-md"
25+
class="absolute inset-0 -z-10 block size-14 scale-110 rounded-full bg-transparent md:hidden md:h-8 md:rounded-md"
3326
></span>
34-
<IconChevronLeft class="inline-block rotate-90 lg:hidden" />
35-
<span
36-
class="sr-only underline decoration-dashed decoration-2 underline-offset-4 group-hover:text-accent lg:not-sr-only"
37-
>
38-
<span class="text-xl" tabindex="0">&uarr;</span> Back To Top
27+
<IconChevronLeft class="inline-block rotate-90 md:hidden" />
28+
<span class="sr-only text-sm group-hover:text-accent md:not-sr-only">
29+
<IconArrowNarrowUp class="inline-block size-4" />
30+
Back To Top
3931
</span>
4032
</button>
4133
</div>

src/components/Breadcrumb.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (breadcrumbList[0] === "tags" && !isNaN(Number(breadcrumbList[2]))) {
2323
}
2424
---
2525

26-
<nav class="mx-auto mt-8 mb-1 w-full max-w-3xl px-4" aria-label="breadcrumb">
26+
<nav class="mx-auto mt-8 mb-1 w-full max-w-app px-4" aria-label="breadcrumb">
2727
<ul
2828
class="font-light [&>li]:inline [&>li:not(:last-child)>a]:hover:opacity-100"
2929
>

src/components/Header.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const isActive = (path: string) => {
3333
</a>
3434
<div
3535
id="nav-container"
36-
class="mx-auto flex max-w-3xl flex-col items-center justify-between sm:flex-row"
36+
class="mx-auto flex max-w-app flex-col items-center justify-between sm:flex-row"
3737
>
3838
<div
3939
id="top-nav-wrap"

src/components/Hr.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ export interface Props {
77
const { noPadding = false, ariaHidden = true } = Astro.props;
88
---
99

10-
<div class={`max-w-3xl mx-auto ${noPadding ? "px-0" : "px-4"}`}>
10+
<div class:list={["mx-auto max-w-app", noPadding ? "px-0" : "px-4"]}>
1111
<hr class="border-border" aria-hidden={ariaHidden} />
1212
</div>

0 commit comments

Comments
 (0)