AndrewUsher / AndrewUsher/andrewusher.dev

Improve code block UX with share and open in playground

オープン
#337 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
TypeScript
スター
1
フォーク
0
平均マージ
2日 5時間
マージ済み PR(30日)
59

説明

The copy button script in src/layouts/BaseLayout.astro:58 works, but it's the only thing we have for a site that writes a lot about code.

Upgrade:
- keep the copy button but add a toast ("Copied") instead of just swapping the icon
- add filename tab when markdown has a title, and show language label
- add "Open in StackBlitz" for runnable examples — reuse the Cookie Store and Durable Streams demos in src/components/blog/* as patterns
- track most-copied blocks with a simple event to PostHog/Plausible so I know what's useful
- make sure it still works after astro:page-load transitions and with keyboard users

No need to rewrite syntax highlighting. Shiki config in astro.config.mjs:62 stays as is. Just the wrapper around pre.astro-code.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。