feat: add SharePanel component for social sharing with QR code support
- Implemented SharePanel component in `SharePanel.astro` for sharing content on social media platforms. - Integrated QR code generation for WeChat sharing using the `qrcode` library. - Added localization support for English and Chinese languages. - Created utility functions in `seo.ts` for building article summaries and FAQs. - Introduced API routes for serving IndexNow key and generating full LLM catalog and summaries. - Enhanced SEO capabilities with structured data for articles and pages.
This commit is contained in:
@@ -294,6 +294,7 @@ export interface ApiSiteSettings {
|
||||
subscription_popup_delay_seconds: number | null;
|
||||
seo_default_og_image: string | null;
|
||||
seo_default_twitter_handle: string | null;
|
||||
seo_wechat_share_qr_enabled: boolean;
|
||||
}
|
||||
|
||||
export interface ContentAnalyticsInput {
|
||||
@@ -491,6 +492,7 @@ export const DEFAULT_SITE_SETTINGS: SiteSettings = {
|
||||
seo: {
|
||||
defaultOgImage: undefined,
|
||||
defaultTwitterHandle: undefined,
|
||||
wechatShareQrEnabled: false,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -509,6 +511,8 @@ const normalizePost = (post: ApiPost): UiPost => ({
|
||||
description: post.description,
|
||||
content: post.content,
|
||||
date: formatPostDate(post.created_at),
|
||||
createdAt: post.created_at,
|
||||
updatedAt: post.updated_at,
|
||||
readTime: estimateReadTime(post.content || post.description),
|
||||
type: post.post_type,
|
||||
tags: post.tags ?? [],
|
||||
@@ -662,6 +666,7 @@ const normalizeSiteSettings = (settings: ApiSiteSettings): SiteSettings => {
|
||||
seo: {
|
||||
defaultOgImage: settings.seo_default_og_image ?? undefined,
|
||||
defaultTwitterHandle: settings.seo_default_twitter_handle ?? undefined,
|
||||
wechatShareQrEnabled: Boolean(settings.seo_wechat_share_qr_enabled),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user