style: add highlight hover animation to navigation and footer

- add dynamic accessible labels to heading anchors
- update theme toggle button svg
This commit is contained in:
radishzzz 2025-05-13 23:33:09 +01:00
parent 2d80d7effd
commit 610c86db0d
21 changed files with 131 additions and 108 deletions

View file

@ -1,3 +1,4 @@
import type { Element } from 'hast'
import mdx from '@astrojs/mdx'
import partytown from '@astrojs/partytown'
import sitemap from '@astrojs/sitemap'
@ -9,6 +10,7 @@ import rehypeKatex from 'rehype-katex'
import rehypeSlug from 'rehype-slug'
import remarkDirective from 'remark-directive'
import remarkMath from 'remark-math'
import { visit } from 'unist-util-visit'
import UnoCSS from 'unocss/astro'
import { themeConfig } from './src/config'
import { langMap } from './src/i18n/config'
@ -98,9 +100,17 @@ export default defineConfig({
},
],
},
properties: {
className: ['heading-anchor-link'],
ariaLabel: 'Link to this section',
properties: (el: Element) => {
let text = ''
visit(el, 'text', (textNode) => {
text += textNode.value
})
return {
className: ['heading-anchor-link'],
ariaLabel: text
? `Link to ${text.replace(/["']/g, char => char === '"' ? '"' : ''')}`
: undefined,
}
},
},
],

View file

@ -17,7 +17,7 @@
"@astrojs/partytown": "^2.1.4",
"@astrojs/sitemap": "^3.4.0",
"@waline/client": "^3.5.7",
"astro": "^5.7.12",
"astro": "^5.7.13",
"astro-og-canvas": "^0.7.0",
"astro-robots-txt": "^1.0.0",
"canvaskit-wasm": "^0.40.0",
@ -36,11 +36,13 @@
"remark-directive": "^4.0.0",
"remark-math": "^6.0.0",
"sanitize-html": "^2.16.0",
"sharp": "^0.34.1",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
"@antfu/eslint-config": "^4.13.0",
"@astrojs/check": "^0.9.4",
"@types/hast": "^3.0.4",
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.15.17",
"@types/sanitize-html": "^2.16.0",
@ -51,7 +53,6 @@
"eslint": "^9.26.0",
"eslint-plugin-astro": "^1.3.1",
"lint-staged": "^16.0.0",
"sharp": "^0.34.1",
"typescript": "~5.8.3",
"unocss": "66.1.1",
"unocss-preset-theme": "^0.14.1"

109
pnpm-lock.yaml generated
View file

@ -10,7 +10,7 @@ importers:
dependencies:
'@astrojs/mdx':
specifier: ^4.2.6
version: 4.2.6(astro@5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1))
version: 4.2.6(astro@5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1))
'@astrojs/partytown':
specifier: ^2.1.4
version: 2.1.4
@ -21,11 +21,11 @@ importers:
specifier: ^3.5.7
version: 3.5.7(typescript@5.8.3)
astro:
specifier: ^5.7.12
version: 5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)
specifier: ^5.7.13
version: 5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)
astro-og-canvas:
specifier: ^0.7.0
version: 0.7.0(astro@5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1))
version: 0.7.0(astro@5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1))
astro-robots-txt:
specifier: ^1.0.0
version: 1.0.0
@ -77,6 +77,9 @@ importers:
sanitize-html:
specifier: ^2.16.0
version: 2.16.0
sharp:
specifier: ^0.34.1
version: 0.34.1
unist-util-visit:
specifier: ^5.0.0
version: 5.0.0
@ -87,6 +90,9 @@ importers:
'@astrojs/check':
specifier: ^0.9.4
version: 0.9.4(typescript@5.8.3)
'@types/hast':
specifier: ^3.0.4
version: 3.0.4
'@types/markdown-it':
specifier: ^14.1.2
version: 14.1.2
@ -117,9 +123,6 @@ importers:
lint-staged:
specifier: ^16.0.0
version: 16.0.0
sharp:
specifier: ^0.34.1
version: 0.34.1
typescript:
specifier: ~5.8.3
version: 5.8.3
@ -1476,8 +1479,8 @@ packages:
astro-robots-txt@1.0.0:
resolution: {integrity: sha512-6JQSLid4gMhoWjOm85UHLkgrw0+hHIjnJVIUqxjU2D6feKlVyYukMNYjH44ZDZBK1P8hNxd33PgWlHzCASvedA==}
astro@5.7.12:
resolution: {integrity: sha512-UQOItiZz2hcv9PlHTQ6dNqFDIVNPnmwk6eyAjJqPE9O8EDHZK2JKtTRD0CBFN2Uqr0RE0TWP2gqDpLfsa5dJEA==}
astro@5.7.13:
resolution: {integrity: sha512-cRGq2llKOhV3XMcYwQpfBIUcssN6HEK5CRbcMxAfd9OcFhvWE7KUy50zLioAZVVl3AqgUTJoNTlmZfD2eG0G1w==}
engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'}
hasBin: true
@ -1573,8 +1576,8 @@ packages:
resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==}
engines: {node: '>=16'}
caniuse-lite@1.0.30001717:
resolution: {integrity: sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==}
caniuse-lite@1.0.30001718:
resolution: {integrity: sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==}
canvaskit-wasm@0.39.1:
resolution: {integrity: sha512-Gy3lCmhUdKq+8bvDrs9t8+qf7RvcjuQn+we7vTVVyqgOVO1UVfHpsnBxkTZw+R4ApEJ3D5fKySl9TU11hmjl/A==}
@ -1774,8 +1777,8 @@ packages:
supports-color:
optional: true
debug@4.4.0:
resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==}
debug@4.4.1:
resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@ -2032,8 +2035,8 @@ packages:
resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==}
engines: {node: '>=5.0.0'}
eslint-plugin-perfectionist@4.12.3:
resolution: {integrity: sha512-V0dmpq6fBbn0BYofHsiRuuY9wgkKMDkdruM0mIRBIJ8XZ8vEaTAZqFsywm40RuWNVnduWBt5HO1ZZ+flE2yqjg==}
eslint-plugin-perfectionist@4.13.0:
resolution: {integrity: sha512-dsPwXwV7IrG26PJ+h1crQ1f5kxay/gQAU0NJnbVTQc91l5Mz9kPjyIZ7fXgie+QSgi8a+0TwGbfaJx+GIhzuoQ==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
eslint: '>=8.45.0'
@ -3000,8 +3003,8 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
napi-postinstall@0.2.3:
resolution: {integrity: sha512-Mi7JISo/4Ij2tDZ2xBE2WH+/KvVlkhA6juEjpEeRAVPNCpN3nxJo/5FhDNKgBcdmcmhaH6JjgST4xY/23ZYK0w==}
napi-postinstall@0.2.4:
resolution: {integrity: sha512-ZEzHJwBhZ8qQSbknHqYcdtQVr8zUgGyM/q6h6qAyhtyVMNrSgDhrC4disf03dYW0e+czXyLnZINnCTEkWy0eJg==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
hasBin: true
@ -4277,7 +4280,7 @@ snapshots:
eslint-plugin-jsonc: 2.20.0(eslint@9.26.0(jiti@2.4.2))
eslint-plugin-n: 17.18.0(eslint@9.26.0(jiti@2.4.2))
eslint-plugin-no-only-tests: 3.3.0
eslint-plugin-perfectionist: 4.12.3(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3)
eslint-plugin-perfectionist: 4.13.0(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3)
eslint-plugin-pnpm: 0.3.1(eslint@9.26.0(jiti@2.4.2))
eslint-plugin-regexp: 2.7.0(eslint@9.26.0(jiti@2.4.2))
eslint-plugin-toml: 0.12.0(eslint@9.26.0(jiti@2.4.2))
@ -4376,12 +4379,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@astrojs/mdx@4.2.6(astro@5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1))':
'@astrojs/mdx@4.2.6(astro@5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1))':
dependencies:
'@astrojs/markdown-remark': 6.3.1
'@mdx-js/mdx': 3.1.0(acorn@8.14.1)
acorn: 8.14.1
astro: 5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)
astro: 5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)
es-module-lexer: 1.7.0
estree-util-visit: 2.0.0
hast-util-to-html: 9.0.5
@ -4413,7 +4416,7 @@ snapshots:
'@astrojs/telemetry@3.2.1':
dependencies:
ci-info: 4.2.0
debug: 4.4.0
debug: 4.4.1
dlv: 1.1.3
dset: 3.1.4
is-docker: 3.0.0
@ -4607,7 +4610,7 @@ snapshots:
'@eslint/config-array@0.20.0':
dependencies:
'@eslint/object-schema': 2.1.6
debug: 4.4.0
debug: 4.4.1
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@ -4625,7 +4628,7 @@ snapshots:
'@eslint/eslintrc@3.3.1':
dependencies:
ajv: 6.12.6
debug: 4.4.0
debug: 4.4.1
espree: 10.3.0
globals: 14.0.0
ignore: 5.3.2
@ -4677,7 +4680,7 @@ snapshots:
'@antfu/install-pkg': 1.1.0
'@antfu/utils': 8.1.1
'@iconify/types': 2.0.0
debug: 4.4.0
debug: 4.4.1
globals: 15.15.0
kolorist: 1.8.0
local-pkg: 1.1.1
@ -5154,7 +5157,7 @@ snapshots:
'@typescript-eslint/types': 8.32.1
'@typescript-eslint/typescript-estree': 8.32.1(typescript@5.8.3)
'@typescript-eslint/visitor-keys': 8.32.1
debug: 4.4.0
debug: 4.4.1
eslint: 9.26.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
@ -5169,7 +5172,7 @@ snapshots:
dependencies:
'@typescript-eslint/typescript-estree': 8.32.1(typescript@5.8.3)
'@typescript-eslint/utils': 8.32.1(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3)
debug: 4.4.0
debug: 4.4.1
eslint: 9.26.0(jiti@2.4.2)
ts-api-utils: 2.1.0(typescript@5.8.3)
typescript: 5.8.3
@ -5182,7 +5185,7 @@ snapshots:
dependencies:
'@typescript-eslint/types': 8.32.1
'@typescript-eslint/visitor-keys': 8.32.1
debug: 4.4.0
debug: 4.4.1
fast-glob: 3.3.3
is-glob: 4.0.3
minimatch: 9.0.5
@ -5699,7 +5702,7 @@ snapshots:
'@typescript-eslint/scope-manager': 8.32.1
'@typescript-eslint/types': 8.32.1
astrojs-compiler-sync: 1.1.1(@astrojs/compiler@2.12.0)
debug: 4.4.0
debug: 4.4.1
entities: 6.0.0
eslint-scope: 8.3.0
eslint-visitor-keys: 4.2.0
@ -5710,9 +5713,9 @@ snapshots:
transitivePeerDependencies:
- supports-color
astro-og-canvas@0.7.0(astro@5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)):
astro-og-canvas@0.7.0(astro@5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)):
dependencies:
astro: 5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)
astro: 5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1)
canvaskit-wasm: 0.39.1
deterministic-object-hash: 2.0.2
entities: 4.5.0
@ -5722,7 +5725,7 @@ snapshots:
valid-filename: 4.0.0
zod: 3.24.4
astro@5.7.12(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1):
astro@5.7.13(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(rollup@4.40.2)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.1):
dependencies:
'@astrojs/compiler': 2.12.0
'@astrojs/internal-helpers': 0.6.1
@ -5740,7 +5743,7 @@ snapshots:
common-ancestor-path: 1.0.1
cookie: 1.0.2
cssesc: 3.0.0
debug: 4.4.0
debug: 4.4.1
deterministic-object-hash: 2.0.2
devalue: 5.1.1
diff: 5.2.0
@ -5846,7 +5849,7 @@ snapshots:
dependencies:
bytes: 3.1.2
content-type: 1.0.5
debug: 4.4.0
debug: 4.4.1
http-errors: 2.0.0
iconv-lite: 0.6.3
on-finished: 2.4.1
@ -5888,7 +5891,7 @@ snapshots:
browserslist@4.24.5:
dependencies:
caniuse-lite: 1.0.30001717
caniuse-lite: 1.0.30001718
electron-to-chromium: 1.5.152
node-releases: 2.0.19
update-browserslist-db: 1.1.3(browserslist@4.24.5)
@ -5916,7 +5919,7 @@ snapshots:
camelcase@8.0.0: {}
caniuse-lite@1.0.30001717: {}
caniuse-lite@1.0.30001718: {}
canvaskit-wasm@0.39.1:
dependencies:
@ -6101,7 +6104,7 @@ snapshots:
dependencies:
ms: 2.1.3
debug@4.4.0:
debug@4.4.1:
dependencies:
ms: 2.1.3
@ -6331,7 +6334,7 @@ snapshots:
dependencies:
'@typescript-eslint/utils': 8.32.1(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3)
comment-parser: 1.4.1
debug: 4.4.0
debug: 4.4.1
eslint: 9.26.0(jiti@2.4.2)
eslint-import-resolver-node: 0.3.9
get-tsconfig: 4.10.0
@ -6350,7 +6353,7 @@ snapshots:
'@es-joy/jsdoccomment': 0.49.0
are-docs-informative: 0.0.2
comment-parser: 1.4.1
debug: 4.4.0
debug: 4.4.1
escape-string-regexp: 4.0.0
eslint: 9.26.0(jiti@2.4.2)
espree: 10.3.0
@ -6389,7 +6392,7 @@ snapshots:
eslint-plugin-no-only-tests@3.3.0: {}
eslint-plugin-perfectionist@4.12.3(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3):
eslint-plugin-perfectionist@4.13.0(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3):
dependencies:
'@typescript-eslint/types': 8.32.1
'@typescript-eslint/utils': 8.32.1(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3)
@ -6422,7 +6425,7 @@ snapshots:
eslint-plugin-toml@0.12.0(eslint@9.26.0(jiti@2.4.2)):
dependencies:
debug: 4.4.0
debug: 4.4.1
eslint: 9.26.0(jiti@2.4.2)
eslint-compat-utils: 0.6.5(eslint@9.26.0(jiti@2.4.2))
lodash: 4.17.21
@ -6470,7 +6473,7 @@ snapshots:
eslint-plugin-yml@1.18.0(eslint@9.26.0(jiti@2.4.2)):
dependencies:
debug: 4.4.0
debug: 4.4.1
escape-string-regexp: 4.0.0
eslint: 9.26.0(jiti@2.4.2)
eslint-compat-utils: 0.6.5(eslint@9.26.0(jiti@2.4.2))
@ -6512,7 +6515,7 @@ snapshots:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.6
debug: 4.4.0
debug: 4.4.1
escape-string-regexp: 4.0.0
eslint-scope: 8.3.0
eslint-visitor-keys: 4.2.0
@ -6621,7 +6624,7 @@ snapshots:
content-type: 1.0.5
cookie: 0.7.2
cookie-signature: 1.2.2
debug: 4.4.0
debug: 4.4.1
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
@ -6693,7 +6696,7 @@ snapshots:
finalhandler@2.1.0:
dependencies:
debug: 4.4.0
debug: 4.4.1
encodeurl: 2.0.0
escape-html: 1.0.3
on-finished: 2.4.1
@ -7184,7 +7187,7 @@ snapshots:
dependencies:
chalk: 5.4.1
commander: 13.1.0
debug: 4.4.0
debug: 4.4.1
lilconfig: 3.1.3
listr2: 8.3.3
micromatch: 4.0.8
@ -7752,7 +7755,7 @@ snapshots:
micromark@4.0.2:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0
debug: 4.4.1
decode-named-character-reference: 1.1.0
devlop: 1.1.0
micromark-core-commonmark: 2.0.3
@ -7815,7 +7818,7 @@ snapshots:
nanoid@3.3.11: {}
napi-postinstall@0.2.3: {}
napi-postinstall@0.2.4: {}
natural-compare@1.4.0: {}
@ -8344,7 +8347,7 @@ snapshots:
router@2.2.0:
dependencies:
debug: 4.4.0
debug: 4.4.1
depd: 2.0.0
is-promise: 4.0.0
parseurl: 1.3.3
@ -8381,7 +8384,7 @@ snapshots:
send@1.2.0:
dependencies:
debug: 4.4.0
debug: 4.4.1
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
@ -8850,7 +8853,7 @@ snapshots:
unrs-resolver@1.7.2:
dependencies:
napi-postinstall: 0.2.3
napi-postinstall: 0.2.4
optionalDependencies:
'@unrs/resolver-binding-darwin-arm64': 1.7.2
'@unrs/resolver-binding-darwin-x64': 1.7.2
@ -8917,7 +8920,7 @@ snapshots:
vite-node@3.1.1(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1):
dependencies:
cac: 6.7.14
debug: 4.4.0
debug: 4.4.1
es-module-lexer: 1.7.0
pathe: 2.0.3
vite: 6.3.5(@types/node@22.15.17)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1)
@ -8966,7 +8969,7 @@ snapshots:
'@vitest/spy': 3.1.1
'@vitest/utils': 3.1.1
chai: 5.2.0
debug: 4.4.0
debug: 4.4.1
expect-type: 1.2.1
magic-string: 0.30.17
pathe: 2.0.3
@ -9107,7 +9110,7 @@ snapshots:
vue-eslint-parser@10.1.3(eslint@9.26.0(jiti@2.4.2)):
dependencies:
debug: 4.4.0
debug: 4.4.1
eslint: 9.26.0(jiti@2.4.2)
eslint-scope: 8.3.0
eslint-visitor-keys: 4.2.0

View file

@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M12 1C5.9 1 1 5.9 1 12s4.9 11 11 11 11-4.9 11-11S18.1 1 12 1m0 20c-5.8 0-10.5-4-10.5-9S6.2 3 12 3s10.5 4 10.5 9-4.7 9-10.5 9"/>
<path d="M12,.5C5.6.5.4,5.6.4,12s5.1,11.5,11.6,11.5,11.5-5.1,11.5-11.5S18.4.5,12,.5M12,21.5C5.9,21.5,1,17.3,1,12S5.9,2.6,12,2.6s11,4.2,11,9.5-4.9,9.4-11,9.4"/>
</svg>

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 229 B

Before After
Before After

View file

@ -50,7 +50,7 @@ const nextUrl = useSupportedLangs
<!-- Theme Toggle -->
<button
aria-label="Switch light/dark theme"
class="button-theme-toggle aspect-square w-4.2 c-secondary active:scale-90 hover:c-primary"
class="button-theme-toggle aspect-square w-4 c-secondary active:scale-90 hover:c-primary"
>
<ThemeToggleIcon
aria-hidden="true"

View file

@ -30,7 +30,7 @@ const links = socialLinks.map((link) => {
<p>
{links.map((link, index) => (
<>
<a class="transition-colors hover:c-primary" href={link.url} target="_blank" rel="noopener noreferrer">
<a class="highlight-hover transition-colors hover:c-primary after:bottom-0!" href={link.url} target="_blank" rel="noopener noreferrer">
{link.name}
</a>
{index < links.length - 1 && ' / '}
@ -39,7 +39,7 @@ const links = socialLinks.map((link) => {
</p>
<p>
Powered by <a class="transition-colors hover:c-primary" href="https://astro.build/" target="_blank" rel="noopener noreferrer">Astro</a> and <a class="transition-colors hover:c-primary" href="https://github.com/radishzzz/astro-theme-retypeset" target="_blank" rel="noopener noreferrer">Retypeset</a>
Powered by <a class="highlight-hover transition-colors hover:c-primary after:bottom-0!" href="https://astro.build/" target="_blank" rel="noopener noreferrer">Astro</a> and <a class="highlight-hover transition-colors hover:c-primary after:bottom-0!" href="https://github.com/radishzzz/astro-theme-retypeset" target="_blank" rel="noopener noreferrer">Retypeset</a>
</p>
<p>

View file

@ -10,7 +10,7 @@ const isTagActive = isTag
const isAboutActive = isAbout
function getNavItemClass(isActive: boolean) {
return isActive ? 'font-bold c-primary' : 'hover:(c-primary font-bold) transition-all'
return isActive ? 'font-bold c-primary highlight-static' : 'hover:(c-primary font-bold) transition-all highlight-hover'
}
const navItems = [

View file

@ -61,5 +61,5 @@ function initBackToTop() {
}
// Handle page transitions
document.addEventListener('astro:page-load', initBackToTop)
document.addEventListener('astro:after-swap', initBackToTop)
</script>

View file

@ -217,6 +217,6 @@ function setupTOCHighlight() {
}
setupTOCHighlight()
document.addEventListener('astro:page-load', setupTOCHighlight)
document.addEventListener('astro:after-swap', setupTOCHighlight)
</script>

View file

@ -1,9 +1,9 @@
---
import { ClientRouter } from 'astro:transitions'
import katexCSS from 'katex/dist/katex.min.css?url'
import { allLocales, defaultLocale, themeConfig } from '@/config'
import { ui } from '@/i18n/ui'
import { getPageInfo } from '@/utils/page'
import { ClientRouter } from 'astro:transitions'
import katexCSS from 'katex/dist/katex.min.css?url'
interface Props {
postTitle?: string

View file

@ -22,7 +22,7 @@ interface Props {
}
const { postTitle, postDescription, postSlug, supportedLangs = [] } = Astro.props
const { isPost, isAbout } = getPageInfo(Astro.url.pathname)
const { isPost } = getPageInfo(Astro.url.pathname)
const fontStyle = themeConfig.global.fontStyle === 'serif' ? 'font-serif' : 'font-sans'
const MarginBottom = isPost && themeConfig.comment?.enabled
? 'mb-10' // Post page with comment system
@ -51,7 +51,7 @@ const MarginBottom = isPost && themeConfig.comment?.enabled
</div>
<Button supportedLangs={supportedLangs} />
<Scrollbar />
{(isPost || isAbout) && <GithubCard />}
{(isPost || isAbout) && <PhotoSwipe />}
<GithubCard />
<PhotoSwipe />
</body>
</html>

View file

@ -9,5 +9,5 @@ import Layout from '@/layouts/Layout.astro'
<h3 class="mt--1.3 text-8 text-primary font-bold leading-1.2em font-navbar lg:text-9">PAGE<br>NOT<br>FOUND</h3>
<p class="mt-3.6 text-3.6 leading-1.4em font-navbar lg:(mt-4 text-4)">It looks like the page you're looking for<br>does not exist or has been moved.</p>
<!-- Unused Div -->
<!-- <div class=""></div> -->
<div class=""></div>
</Layout>

View file

@ -1,7 +1,7 @@
---
import { getCollection, render } from 'astro:content'
import { defaultLocale, moreLocales } from '@/config'
import Layout from '@/layouts/Layout.astro'
import { getCollection, render } from 'astro:content'
export async function getStaticPaths() {
type PathItem = {

View file

@ -1,5 +1,6 @@
---
import type { CollectionEntry } from 'astro:content'
import { getCollection, render } from 'astro:content'
import Comments from '@/components/Comments/index.astro'
import PostDate from '@/components/PostDate.astro'
import GoBack from '@/components/Widgets/GoBack.astro'
@ -9,7 +10,6 @@ import { getTagPath } from '@/i18n/path'
import Layout from '@/layouts/Layout.astro'
import { checkPostSlugDuplication } from '@/utils/content'
import { generateDescription } from '@/utils/description'
import { getCollection, render } from 'astro:content'
export async function getStaticPaths() {
const posts = await getCollection('posts')

View file

@ -1,7 +1,7 @@
import type { CollectionEntry } from 'astro:content'
import { generateDescription } from '@/utils/description'
import { OGImageRoute } from 'astro-og-canvas'
import { getCollection } from 'astro:content'
import { generateDescription } from '@/utils/description'
// eslint-disable-next-line antfu/no-top-level-await
const blogEntries = await getCollection('posts')

View file

@ -6,16 +6,31 @@
html {
--at-apply: 'bg-background c-secondary antialiased';
}
/* Fix flash issue on iOS */
::selection {
--at-apply: 'bg-mark';
}
/* Fix Flash Issue On iOS */
body {
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
::selection {
--at-apply: 'bg-mark';
/* Highlight Hover Animation */
.highlight-static,
.highlight-hover {
--at-apply: 'relative inline-block';
}
html.dark ::selection {
--at-apply: 'c-background';
.highlight-static::after,
.highlight-hover::after {
--at-apply: 'content-[""] absolute bottom-0.5em left-0 z--1 h-0.5em w-full bg-mark';
}
.highlight-static::after,
.highlight-hover:hover::after {
--at-apply: 'origin-bottom-left scale-x-100';
}
.highlight-hover::after {
--at-apply: 'origin-bottom-right scale-x-0 transition-transform duration-300 ease-out';
}
/* View Transition with Theme Toggle >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */

View file

@ -22,7 +22,7 @@
.heti :where(h4),
.heti :where(h5),
.heti :where(h6) {
--at-apply: 'mt-6 mb-3 font-semibold';
--at-apply: 'mb-3 mt-6 font-semibold';
}
.heti :where(h1) {
--at-apply: 'text-7 leading-12';
@ -62,7 +62,7 @@
/* Links */
.heti :where(a:not(.gc-container)) {
--at-apply: 'break-all font-medium tracking-0 underline decoration-secondary/40 underline-0.075em underline-offset-0.2em';
--at-apply: 'break-all font-medium tracking-0 underline underline-0.075em decoration-secondary/40 underline-offset-0.2em';
--at-apply: 'transition-colors hover:(c-primary decoration-secondary/80) lg:underline-0.1em';
}
@ -81,10 +81,10 @@
/* Code Blocks */
.heti :where(pre) {
--at-apply: 'mb-4 px-4 py-3 overflow-auto uno-round-border bg-secondary/5!';
--at-apply: 'mb-4 overflow-auto uno-round-border px-4 py-3 bg-secondary/5!';
}
.heti pre :where(code) {
--at-apply: 'p-0 border-none bg-transparent';
--at-apply: 'border-none bg-transparent p-0';
}
html.dark .heti pre :where(span) {
--at-apply: 'text-[var(--shiki-dark)]!';
@ -92,14 +92,14 @@ html.dark .heti pre :where(span) {
/* Inline Code */
.heti :where(code) {
--at-apply: 'px-0.4em py-0.2em text-0.85em tracking-0 uno-round-border bg-secondary/5 cjk:break-all';
--at-apply: 'uno-round-border bg-secondary/5 px-0.4em py-0.2em text-0.85em tracking-0 cjk:break-all';
counter-reset: line;
}
.heti :where(code) span.line {
--at-apply: 'relative pl-8';
}
.heti :where(code) span.line::before {
--at-apply: 'absolute left-0 w-4 leading-1.9em text-secondary/40';
--at-apply: 'absolute left-0 w-4 text-secondary/40 leading-1.9em';
content: counter(line);
counter-increment: line;
direction: rtl;
@ -107,7 +107,7 @@ html.dark .heti pre :where(span) {
/* Blockquotes */
.heti :where(blockquote) {
--at-apply: 'mb-4 px-4 py-0.5 c-secondary/80 border-l-4 border-solid border-secondary/25';
--at-apply: 'mb-4 border-l-4 border-secondary/25 border-solid px-4 py-0.5 c-secondary/80';
}
.heti blockquote[class*="admonition-"] {
--at-apply: 'py-1.5 c-secondary';
@ -124,14 +124,14 @@ html.dark .heti pre :where(span) {
/* Tables */
.heti :where(table) {
--at-apply: 'mb-4 block box-border table-fixed max-w-full overflow-x-auto scrollbar-hidden';
--at-apply: 'mb-4 box-border block max-w-full table-fixed overflow-x-auto scrollbar-hidden';
}
.heti :where(table)::-webkit-scrollbar {
--at-apply: 'hidden';
}
.heti :where(th),
.heti :where(td) {
--at-apply: 'px-3 pb-1.5 border-b border-b-secondary/25';
--at-apply: 'border-b border-b-secondary/25 px-3 pb-1.5';
}
.heti :where(tr td:first-child),
.heti :where(tr th:first-child) {
@ -157,7 +157,7 @@ html.dark .heti pre :where(span) {
.heti ul :where(ol),
.heti ol :where(ul),
.heti ol :where(ol) {
--at-apply: 'mt-0 mb-0.25em';
--at-apply: 'mb-0.25em mt-0';
}
.heti :where(ul) {
--at-apply: 'list-disc';
@ -182,7 +182,7 @@ html.dark .heti pre :where(span) {
/* Superscript and Subscript >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
.heti :where(sub),
.heti :where(sup) {
--at-apply: 'relative mx-0.1em text-0.75em leading-1 align-baseline';
--at-apply: 'relative mx-0.1em align-baseline text-0.75em leading-1';
}
.heti :where(sub) {
--at-apply: 'bottom--0.25em';
@ -193,15 +193,15 @@ html.dark .heti pre :where(span) {
/* Abbreviations */
.heti :where(abbr[title]) {
--at-apply: 'pb-0.25 no-underline border-b-1 border-dotted border-secondary cursor-help';
--at-apply: 'cursor-help border-b-1 border-secondary border-dotted pb-0.25 no-underline';
}
/* Wavy Underline */
.heti :where(u) {
--at-apply: 'underline underline-offset-0.25em decoration-wavy decoration-red-400';
--at-apply: 'underline decoration-red-400 underline-offset-0.25em decoration-wavy';
}
html.dark .heti :where(u) {
--at-apply: 'decoration-red-400/80';
--at-apply: 'decoration-red-400/60';
}
/* Keyboard Input */
@ -212,10 +212,7 @@ html.dark .heti :where(u) {
/* Highlighted Text */
.heti :where(mark) {
--at-apply: 'py-0.25 text-inherit bg-mark';
}
html.dark .heti :where(mark) {
--at-apply: 'text-background';
--at-apply: 'bg-mark py-0.65 text-inherit';
}
/* Footnotes */
@ -227,12 +224,8 @@ html.dark .heti :where(mark) {
.heti sup a:target {
--at-apply: 'bg-mark';
}
html.dark .heti sup:target,
html.dark .heti sup a:target {
--at-apply: 'text-background';
}
.heti .data-footnote-backref {
--at-apply: 'no-underline font-serif';
--at-apply: 'font-serif no-underline';
}
/* Horizontal Rules */

View file

@ -1,7 +1,7 @@
import type { CollectionEntry } from 'astro:content'
import { getCollection, render } from 'astro:content'
import { defaultLocale } from '@/config'
import { memoize } from '@/utils/cache'
import { getCollection, render } from 'astro:content'
/**
* Core Functions

View file

@ -1,6 +1,6 @@
import type { CollectionEntry } from 'astro:content'
import { defaultLocale } from '@/config'
import MarkdownIt from 'markdown-it'
import { defaultLocale } from '@/config'
type ExcerptScene = 'list' | 'meta' | 'og' | 'feed'

View file

@ -1,16 +1,16 @@
import type { APIContext, ImageMetadata } from 'astro'
import type { CollectionEntry } from 'astro:content'
import type { Author } from 'feed'
import { defaultLocale, themeConfig } from '@/config'
import { ui } from '@/i18n/ui'
import { memoize } from '@/utils/cache'
import { generateDescription } from '@/utils/description'
import { getImage } from 'astro:assets'
import { getCollection } from 'astro:content'
import { Feed } from 'feed'
import MarkdownIt from 'markdown-it'
import { parse as htmlParser } from 'node-html-parser'
import sanitizeHtml from 'sanitize-html'
import { defaultLocale, themeConfig } from '@/config'
import { ui } from '@/i18n/ui'
import { memoize } from '@/utils/cache'
import { generateDescription } from '@/utils/description'
interface GenerateFeedOptions {
lang?: string

View file

@ -20,6 +20,7 @@ export default defineConfig({
dark: {
colors: {
...dark,
mark: 'oklch(0.93 0.195089 103.2532 / 0.2)', // rgba(255,235,0,0.5)
note: 'oklch(70.7% 0.165 254.624 / 0.8)', // blue-400
tip: 'oklch(76.5% 0.177 163.223 / 0.8)', // emerald-400
important: 'oklch(71.4% 0.203 305.504 / 0.8)', // purple-400