This commit is contained in:
+2
-1
@@ -178,12 +178,13 @@ export default function Home() {
|
||||
await navigator.share({
|
||||
title: "hidden11",
|
||||
text: shareText,
|
||||
url: shareUrl,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
window.open(
|
||||
`https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}`,
|
||||
`https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}&url=${encodeURIComponent(shareUrl)}`,
|
||||
"_blank",
|
||||
"noopener,noreferrer",
|
||||
);
|
||||
|
||||
@@ -24,16 +24,22 @@ export async function generateMetadata({ params }: ResultPageProps): Promise<Met
|
||||
return {
|
||||
title: `hidden11 #${payload.puzzleNumber} shared result`,
|
||||
description: `Shared hidden11 result for puzzle #${payload.puzzleNumber}.`,
|
||||
alternates: {
|
||||
canonical: `https://hidden11.app/r/${shareCode}`,
|
||||
},
|
||||
openGraph: {
|
||||
title: `hidden11 #${payload.puzzleNumber}`,
|
||||
description: "Shared daily result",
|
||||
images: [`/result/${shareCode}/opengraph-image`],
|
||||
url: `https://hidden11.app/r/${shareCode}`,
|
||||
siteName: "hidden11",
|
||||
images: [`https://hidden11.app/r/${shareCode}/opengraph-image`],
|
||||
type: "website",
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image",
|
||||
title: `hidden11 #${payload.puzzleNumber}`,
|
||||
description: "Shared daily result",
|
||||
images: [`/result/${shareCode}/twitter-image`],
|
||||
images: [`https://hidden11.app/r/${shareCode}/twitter-image`],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export default function ShareResult({ dateKey, locale, onClose, progress, quote,
|
||||
await navigator.share({
|
||||
title: "hidden11",
|
||||
text: shareText,
|
||||
url: shareUrl,
|
||||
});
|
||||
setShared(true);
|
||||
window.setTimeout(() => setShared(false), 1600);
|
||||
@@ -37,7 +38,7 @@ export default function ShareResult({ dateKey, locale, onClose, progress, quote,
|
||||
}
|
||||
|
||||
window.open(
|
||||
`https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}`,
|
||||
`https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}&url=${encodeURIComponent(shareUrl)}`,
|
||||
"_blank",
|
||||
"noopener,noreferrer",
|
||||
);
|
||||
|
||||
@@ -25,7 +25,6 @@ type SharePayload = {
|
||||
};
|
||||
|
||||
export function buildShareText(dateKey: string, progress: DailyProgress, t: Dictionary, shareUrl?: string): string {
|
||||
const resultUrl = shareUrl ?? "https://hidden11.app";
|
||||
const homeUrl = "https://hidden11.app";
|
||||
const rows = DIFFICULTIES.map((difficulty) => {
|
||||
const item = progress[difficulty];
|
||||
@@ -55,7 +54,6 @@ export function buildShareText(dateKey: string, progress: DailyProgress, t: Dict
|
||||
...rows,
|
||||
"",
|
||||
`Play: ${homeUrl}`,
|
||||
`Result: ${resultUrl}`,
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user