mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 03:32:51 +02:00
perf: change listener from after-swap to page-load to improve view transition smoothness
- fix theme guide error - update readme
This commit is contained in:
parent
59297d534e
commit
3a002d61ca
13 changed files with 18 additions and 16 deletions
|
@ -116,5 +116,5 @@ function setupThemeToggle() {
|
|||
|
||||
// Initialize click event (on first load or page transition)
|
||||
setupThemeToggle()
|
||||
document.addEventListener('astro:after-swap', setupThemeToggle)
|
||||
document.addEventListener('astro:page-load', setupThemeToggle)
|
||||
</script>
|
||||
|
|
|
@ -61,7 +61,7 @@ function initWaline() {
|
|||
}
|
||||
|
||||
initWaline()
|
||||
document.addEventListener('astro:after-swap', initWaline)
|
||||
document.addEventListener('astro:page-load', initWaline)
|
||||
</script>
|
||||
|
||||
<!-- Custom CSS Styles >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
|
|
|
@ -32,5 +32,5 @@ function setupBackButton() {
|
|||
}
|
||||
|
||||
setupBackButton()
|
||||
document.addEventListener('astro:after-swap', setupBackButton)
|
||||
document.addEventListener('astro:page-load', setupBackButton)
|
||||
</script>
|
||||
|
|
|
@ -232,6 +232,6 @@ function setupTOCHighlight() {
|
|||
}
|
||||
|
||||
setupTOCHighlight()
|
||||
document.addEventListener('astro:after-swap', setupTOCHighlight)
|
||||
document.addEventListener('astro:page-load', setupTOCHighlight)
|
||||
</script>
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ Beyond the configuration file `src/config.ts`, there are some configuration opti
|
|||
Code block syntax highlighting themes.
|
||||
|
||||
```ts
|
||||
// src/astro.config.ts
|
||||
// astro.config.ts
|
||||
|
||||
shikiConfig: {
|
||||
// available themes: https://shiki.style/themes
|
||||
|
|
|
@ -288,7 +288,7 @@ Más allá del archivo de configuración `src/config.ts`, hay algunas opciones d
|
|||
Temas de resaltado de sintaxis para bloques de código.
|
||||
|
||||
```ts
|
||||
// src/astro.config.ts
|
||||
// astro.config.ts
|
||||
|
||||
shikiConfig: {
|
||||
// temas disponibles: https://shiki.style/themes
|
||||
|
|
|
@ -288,7 +288,7 @@ src/content/posts/2025/03/apple.md -> example.com/es/posts/banana/
|
|||
コードブロックのシンタックスハイライトテーマ。
|
||||
|
||||
```ts
|
||||
// src/astro.config.ts
|
||||
// astro.config.ts
|
||||
|
||||
shikiConfig: {
|
||||
// 利用可能なテーマ: https://shiki.style/themes
|
||||
|
|
|
@ -288,7 +288,7 @@ src/content/posts/2025/03/apple.md -> example.com/es/posts/banana/
|
|||
Темы подсветки синтаксиса для блоков кода.
|
||||
|
||||
```ts
|
||||
// src/astro.config.ts
|
||||
// astro.config.ts
|
||||
|
||||
shikiConfig: {
|
||||
// доступные темы: https://shiki.style/themes
|
||||
|
|
|
@ -288,7 +288,7 @@ src/content/posts/2025/03/apple.md -> example.com/es/posts/banana/
|
|||
代碼塊的語法高亮主題。
|
||||
|
||||
```ts
|
||||
// src/astro.config.ts
|
||||
// astro.config.ts
|
||||
|
||||
shikiConfig: {
|
||||
// 可選主題:https://shiki.style/themes
|
||||
|
|
|
@ -288,7 +288,7 @@ src/content/posts/2025/03/apple.md -> example.com/es/posts/banana/
|
|||
代码块的语法高亮主题。
|
||||
|
||||
```ts
|
||||
// src/astro.config.ts
|
||||
// astro.config.ts
|
||||
|
||||
shikiConfig: {
|
||||
// 可选主题:https://shiki.style/themes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue