feat: allow to define format for page title

respect this config option also when generating static content.

closes #376
This commit is contained in:
Danny Koppenhagen
2023-06-19 14:44:28 +02:00
committed by Stefan Rotsch
parent 8876d3b1c7
commit 810db6aea6
8 changed files with 34 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
import { useEffect } from "react";
import { radarName } from "../config";
import { setTitle } from "../config";
type SetTitleProps = {
title: string;
@@ -8,7 +8,7 @@ type SetTitleProps = {
export default function SetTitle({ title }: SetTitleProps) {
useEffect(() => {
document.title = `${title} | ${radarName}`;
setTitle(document, title)
}, [title]);
return null;