Skip to main content

[Optimization] Basics

優化好文:

1.騰訊優化分享

前端 CoreWebVital 優化

https://gcdeng.com/blog/a-guidebook-to-optimize-web-vitals

social media tag for twitter/fb

功能:在 social media 中貼上連結時可以顯示圖片跟文字


{/* OpenGraph tags */}
<meta name="og:url" content={url} />
<meta name="og:title" content={title} />
<meta name="og:description" content={description} />
<meta name="og:image" content={image} />
<meta name="og:type" content="website" />
<meta name="fb:app_id" content={facebook.appId} />
{/* Twitter Card tags */}
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={image} />
<meta name="twitter:card" content="summary" />
<meta
name="twitter:creator"
content={config.authorTwitterAccount ? config.authorTwitterAccount : ""}
/>

在 react 中可以用 react-helmet(https://www.npmjs.com/package/react-helmet)

https://edwardbeazer.com/social-meta-tags/

按需輸入

vite 按需輸入 with antd

https://github.com/meowtec/vite-plugin-import/issues/2#issuecomment-782555233 https://juejin.cn/post/6926850164015497229 https://3x.ant.design/docs/react/getting-started-cn