Skip to content

Conversation

@JoeyC-Dev
Copy link
Contributor

@JoeyC-Dev JoeyC-Dev commented Feb 1, 2026

Type of change

  • Bug fix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING document.
  • I have checked to ensure that this Pull Request is not for personal changes.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings.

Related Issue

Fix: #724

Changes

  • Add inline script in Layout.astro head to set data-theme-mode attribute before rendering
  • Move search bar to Navbar.astro
  • Move pagefind script to Layout.astro
  • Change Search component from client:only to client:load
  • Search.svelte now only renders search panel, connects to Astro elements via onMount
  • LightDarkSwitch.svelte now only renders dropdown panel, wires up events via onMount
  • Add modulepreload hint for parallel fetching
  • Register icons from @iconify-json packages using addIcon() in Svelte components

How To Test

Use Slow 4G mode to check if the pagefind and LightDarkSwitch icons are being loaded together with Navbar.

Screenshots (if applicable)

image

(Caption: It is now showing with navbar.)

Additional Notes

The following files provided via CDN have sizes of 1.3 KB and 0.9 KB: (external CDN itself will cause delay)

I don't think there is any need for these files to be loaded from CDN. So I removed them.

@vercel
Copy link

vercel bot commented Feb 1, 2026

@JoeyC-Dev is attempting to deploy a commit to the zephyirdgmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

The issue only occurs when there are two themes for expressive code.

Signed-off-by: Joey Chen <142381267+JoeyC-Dev@users.noreply.github.com>
Signed-off-by: Joey Chen <142381267+JoeyC-Dev@users.noreply.github.com>

fix: astro check issue
CMSZ001 pushed a commit to CMSZ001/fuwari that referenced this pull request Feb 9, 2026
- 将搜索栏和主题切换按钮移至 Astro 组件以实现即时渲染
- 预加载关键图标以消除 CDN 请求延迟
- 将 Pagefind 脚本加载逻辑移至主布局,减少重复代码
- 通过 data-theme-mode 属性同步主题状态,避免样式闪烁
- [#725](saicaca/fuwari#725)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: pagefind and LightDarkSwitch icon is not shown in initial load

1 participant