18 lines
818 B
TypeScript
18 lines
818 B
TypeScript
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]);
|
||
}
|