diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-15 22:01:29 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-15 22:01:29 +0900 |
| commit | dea594c6dda0f84ee3ebf6982ea1c98ff760bf71 (patch) | |
| tree | f335463efbd05962e80a07ee6ea3497ea7c2a849 /src/components/starlight | |
| parent | 2d287d60868a5059ad3ba3938ef0972ead0ff066 (diff) | |
SocialShare: X投稿のキャプションをページごとに生成
Diffstat (limited to 'src/components/starlight')
| -rw-r--r-- | src/components/starlight/Footer.astro | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/starlight/Footer.astro b/src/components/starlight/Footer.astro index 7c3871c..5b59d09 100644 --- a/src/components/starlight/Footer.astro +++ b/src/components/starlight/Footer.astro @@ -5,10 +5,17 @@ import Pagination from 'virtual:starlight/components/Pagination'; import config from 'virtual:starlight/user-config'; import { Icon } from '@astrojs/starlight/components'; import SocialShare from '../SocialShare.astro'; +import { shareCaption } from '../../utils/share-caption'; + +const route = Astro.locals.starlightRoute; +const caption = shareCaption( + route.entry?.slug || route.id || '', + route.entry?.data?.title, +); --- <footer class="sl-flex"> - <SocialShare /> + <SocialShare title={caption} /> <div class="meta sl-flex"> <EditLink /> |
