Add sharing buttons and optimize social media previews for articles
Integrates social sharing buttons into article pages and implements server-side Open Graph meta tags for improved link previews on social platforms. Updates image URLs in gallery data. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 83d8fce0-d4ba-4eff-b4de-771170e3b028 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/jdAEdU5 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
b7bac69edc
commit
4c010e9211
@ -10,6 +10,7 @@ import Header from "@/components/header";
|
|||||||
import Footer from "@/components/footer";
|
import Footer from "@/components/footer";
|
||||||
import { InArticleAd } from "@/components/adsense";
|
import { InArticleAd } from "@/components/adsense";
|
||||||
import DOMPurify from "dompurify";
|
import DOMPurify from "dompurify";
|
||||||
|
import ShareButtons from "@/components/share-buttons";
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
|
|
||||||
const ALLOWED_IFRAME_DOMAINS = [
|
const ALLOWED_IFRAME_DOMAINS = [
|
||||||
@ -199,6 +200,14 @@ export default function ArticlePage() {
|
|||||||
{article.views.toLocaleString()} Aufrufe
|
{article.views.toLocaleString()} Aufrufe
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="mt-4">
|
||||||
|
<ShareButtons
|
||||||
|
url={`${window.location.origin}/article/${article.slug}`}
|
||||||
|
title={article.title}
|
||||||
|
image={article.coverImage ? (article.coverImage.startsWith("http") ? article.coverImage : `${window.location.origin}${article.coverImage}`) : undefined}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(() => {
|
{(() => {
|
||||||
@ -245,6 +254,14 @@ export default function ArticlePage() {
|
|||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
|
|
||||||
|
<div className="mt-8 pt-6 border-t border-border">
|
||||||
|
<ShareButtons
|
||||||
|
url={`${window.location.origin}/article/${article.slug}`}
|
||||||
|
title={article.title}
|
||||||
|
image={article.coverImage ? (article.coverImage.startsWith("http") ? article.coverImage : `${window.location.origin}${article.coverImage}`) : undefined}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<RelatedArticles currentSlug={slug || ""} />
|
<RelatedArticles currentSlug={slug || ""} />
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user