Improve website SEO by adding keywords and dynamic page titles
Implement a global SEO strategy with updated meta tags in index.html and dynamic page titles and descriptions using the usePageMeta hook across various page components, including articles, categories, and static pages. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ce7d26d1-8092-4d73-8c8e-9589576d7f9d Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/EtK2Sno Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { useEffect } from "react";
|
||||
|
||||
export function usePageMeta(title: string, description?: string) {
|
||||
useEffect(() => {
|
||||
const suffix = " | Folx Music Television";
|
||||
document.title = title + suffix;
|
||||
if (description) {
|
||||
let meta = document.querySelector('meta[name="description"]') as HTMLMetaElement;
|
||||
if (meta) meta.content = description;
|
||||
}
|
||||
return () => {
|
||||
document.title = "Folx Music Television - Volksmusik & Schlager TV Sender | folx.tv";
|
||||
let meta = document.querySelector('meta[name="description"]') as HTMLMetaElement;
|
||||
if (meta) meta.content = "FOLX TV – Ihr Fernsehsender für Volksmusik und Schlager. Musikvideos, Live-Shows, Interviews und aktuelle Nachrichten aus der Welt der volkstümlichen Musik. Jetzt einschalten!";
|
||||
};
|
||||
}, [title, description]);
|
||||
}
|
||||
Reference in New Issue
Block a user