From 09fe7dcb3789c2623286f92b49b58872a43f1b91 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Fri, 21 Feb 2025 08:33:00 +0000 Subject: [PATCH] refactor: remove text-62.5%, update site layout and add site footer - Adjust font and typography settings across components - Update footer with new links and start year configuration - Modify header and navbar styling for responsive design - Remove @unpic/astro dependency - Refine global and component-level styling - Update font preloading and font face definitions --- package.json | 1 - pnpm-lock.yaml | 67 ------- src/components/Footer.astro | 40 +++++ src/components/LanguageSwitcher.astro | 2 +- src/components/MainHeader.astro | 19 +- src/components/MobileHeader.astro | 16 +- src/components/Navbar.astro | 5 +- src/components/ThemeToggle.astro | 4 +- src/config.ts | 9 +- src/layouts/Head.astro | 3 +- src/layouts/Layout.astro | 32 ++-- src/pages/index.astro | 14 +- src/pages/posts/[slug].astro | 4 +- src/styles/font.css | 244 +++++++++++++------------- src/styles/global.css | 12 +- src/styles/heti.css | 10 +- src/types/index.d.ts | 1 + uno.config.ts | 4 +- 18 files changed, 238 insertions(+), 249 deletions(-) diff --git a/package.json b/package.json index a619b62..cc06279 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "@astrojs/rss": "^4.0.11", "@astrojs/sitemap": "^3.2.1", "@rehype-pretty/transformers": "^0.13.2", - "@unpic/astro": "^1.0.0", "astro": "^5.3.0", "astro-compress": "^2.3.6", "astro-robots-txt": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2aee930..3a0d8d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,9 +26,6 @@ importers: '@rehype-pretty/transformers': specifier: ^0.13.2 version: 0.13.2 - '@unpic/astro': - specifier: ^1.0.0 - version: 1.0.0(astro@5.3.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.34.8)(terser@5.37.0)(typescript@5.7.3)(yaml@2.7.0)) astro: specifier: ^5.3.0 version: 5.3.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.34.8)(terser@5.37.0)(typescript@5.7.3)(yaml@2.7.0) @@ -918,9 +915,6 @@ packages: '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} - '@types/pngjs@6.0.5': - resolution: {integrity: sha512-0k5eKfrA83JOZPppLtS2C7OUtyNAl2wKNxfyYl9Q5g9lPkgBl/9hNyAu6HuEH2J4XmIv2znEpkDd0SaZVxW6iQ==} - '@types/sanitize-html@2.13.0': resolution: {integrity: sha512-X31WxbvW9TjIhZZNyNBZ/p5ax4ti7qsNDBDEnH4zAgmEh35YnFD1UiS6z9Cd34kKm0LslFW0KPmTQzu/oGtsqQ==} @@ -1077,20 +1071,6 @@ packages: peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 - '@unpic/astro@1.0.0': - resolution: {integrity: sha512-LC7PriiuAZ5EuD2u2Dgne5UzG+FvuyZNV0zc1ajkJXX4sUMOvj0FWjZc0pEYEgzTnlOGkN91x2nI9gEtDSOIyA==} - peerDependencies: - astro: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-beta - - '@unpic/core@1.0.1': - resolution: {integrity: sha512-e0cwxOhtWPd4J32rV1V6jFmDGAi1r4p/f+lDqlnx+fhgFwMTyQQKw5lL7VEthUPBHFNaNBsXNbNKwnaIs2V71Q==} - - '@unpic/pixels@1.3.0': - resolution: {integrity: sha512-Xe3J4KU9m2NWCDZ9iwIIRYFe7VwkWEqGCy4yoKMEkjoxpcQ7TPxD+QmdTphv3yiTmrDMMIWYEEH+j4mT6dILTA==} - - '@unpic/placeholder@0.1.2': - resolution: {integrity: sha512-O++tS97biojo5sqn5TeTt+jUjl5gWOdIQuOXe8YluTJWq4L0GM6VuTkaspNpsmxHfioJw/6YBirzOpG4t87l8Q==} - '@vitest/eslint-plugin@1.1.31': resolution: {integrity: sha512-xlsLr+e+AXZ/00eVZCtNmMeCJoJaRCoLDiAgLcxgQjSS1EertieB2MUHf8xIqPKs9lECc/UpL+y1xDcpvi02hw==} peerDependencies: @@ -1268,9 +1248,6 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} - blurhash@2.0.5: - resolution: {integrity: sha512-cRygWd7kGBQO3VEhPiTgq4Wc43ctsM+o46urrmPOiuAe+07fzlSB9OJVdpgDL0jPqXUVQ9ht7aq7kxOeJHRK+w==} - boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -2206,9 +2183,6 @@ packages: resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} hasBin: true - jpeg-js@0.4.4: - resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2834,10 +2808,6 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - pngjs@7.0.0: - resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==} - engines: {node: '>=14.19.0'} - postcss-selector-parser@6.1.2: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} @@ -3408,9 +3378,6 @@ packages: vite: optional: true - unpic@4.1.2: - resolution: {integrity: sha512-sau6i25EUxumNIL7e0kDpPWkVw3yxghLYcEwxPvm08263UfABDxtUJPT3H55z7W15cVXJB/PEhw4z6Oc+idWCA==} - unplugin-utils@0.2.4: resolution: {integrity: sha512-8U/MtpkPkkk3Atewj1+RcKIjb5WBimZ/WSLhhR3w6SsIj8XJuKTacSP8g+2JhfSGw0Cb125Y+2zA/IzJZDVbhA==} engines: {node: '>=18.12.0'} @@ -4543,10 +4510,6 @@ snapshots: '@types/normalize-package-data@2.4.4': {} - '@types/pngjs@6.0.5': - dependencies: - '@types/node': 22.13.4 - '@types/sanitize-html@2.13.0': dependencies: htmlparser2: 8.0.2 @@ -4803,28 +4766,6 @@ snapshots: transitivePeerDependencies: - vue - '@unpic/astro@1.0.0(astro@5.3.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.34.8)(terser@5.37.0)(typescript@5.7.3)(yaml@2.7.0))': - dependencies: - '@unpic/core': 1.0.1 - '@unpic/pixels': 1.3.0 - '@unpic/placeholder': 0.1.2 - astro: 5.3.0(@types/node@22.13.4)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.34.8)(terser@5.37.0)(typescript@5.7.3)(yaml@2.7.0) - blurhash: 2.0.5 - - '@unpic/core@1.0.1': - dependencies: - unpic: 4.1.2 - - '@unpic/pixels@1.3.0': - dependencies: - '@types/pngjs': 6.0.5 - jpeg-js: 0.4.4 - pngjs: 7.0.0 - - '@unpic/placeholder@0.1.2': - dependencies: - blurhash: 2.0.5 - '@vitest/eslint-plugin@1.1.31(@typescript-eslint/utils@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': dependencies: '@typescript-eslint/utils': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) @@ -5179,8 +5120,6 @@ snapshots: binary-extensions@2.3.0: {} - blurhash@2.0.5: {} - boolbase@1.0.0: {} boxen@8.0.1: @@ -6274,8 +6213,6 @@ snapshots: jiti@2.4.2: {} - jpeg-js@0.4.4: {} - js-tokens@4.0.0: {} js-yaml@3.14.1: @@ -7189,8 +7126,6 @@ snapshots: pluralize@8.0.0: {} - pngjs@7.0.0: {} - postcss-selector-parser@6.1.2: dependencies: cssesc: 3.0.0 @@ -7947,8 +7882,6 @@ snapshots: - supports-color - vue - unpic@4.1.2: {} - unplugin-utils@0.2.4: dependencies: pathe: 2.0.3 diff --git a/src/components/Footer.astro b/src/components/Footer.astro index e69de29..f7db0f4 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -0,0 +1,40 @@ +--- +import themeConfig from '@/config' + +interface Props { + class?: string +} + +const { class: className } = Astro.props +const { author } = themeConfig.site +const { + startYear, + linkA: { name: linkAName, url: linkAUrl }, + linkB: { name: linkBName, url: linkBUrl }, + linkC: { name: linkCName, url: linkCUrl }, +} = themeConfig.footer + +const currentYear = new Date().getFullYear() +const year = Number(startYear) === currentYear + ? startYear + : `${startYear}-${currentYear}` +--- + + diff --git a/src/components/LanguageSwitcher.astro b/src/components/LanguageSwitcher.astro index d67ed48..6e3ebac 100644 --- a/src/components/LanguageSwitcher.astro +++ b/src/components/LanguageSwitcher.astro @@ -16,7 +16,7 @@ function getLanguageDisplayName(code: string) {