feat(website): adjust page title

This commit is contained in:
Elian Doran 2025-09-27 13:55:04 +03:00
parent 5e07231d78
commit 4e4e65b462
No known key found for this signature in database
5 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import { useEffect } from "preact/hooks";
export function usePageTitle(title: string) {
useEffect(() => {
if (title.length) {
document.title = `${title} - Trilium Notes`;
} else {
document.title = "Trilium Notes";
}
}, [ title ]);
}

View File

@ -5,8 +5,11 @@ import paypalIcon from "../../assets/boxicons/bx-paypal.svg?raw";
import buyMeACoffeeIcon from "../../assets/boxicons/bx-buy-me-a-coffee.svg?raw";
import Button from "../../components/Button";
import Card from "../../components/Card";
import { usePageTitle } from "../../hooks";
export default function Donate() {
usePageTitle("Support us");
return (
<>
<Section title="Support us" className="donate fill">

View File

@ -3,9 +3,11 @@ import Card from "../../components/Card";
import Section from "../../components/Section";
import { App, Architecture, buildDownloadUrl, downloadMatrix, DownloadMatrixEntry, getArchitecture, Platform } from "../../download-helper";
import "./download.css";
import { usePageTitle } from "../../hooks";
export default function DownloadPage() {
const [ currentArch, setCurrentArch ] = useState(getArchitecture());
usePageTitle("Download");
return (
<>

View File

@ -3,8 +3,11 @@ import Card from '../../components/Card';
import Section from '../../components/Section';
import DownloadButton from '../../components/DownloadButton';
import "./index.css";
import { usePageTitle } from '../../hooks';
export function Home() {
usePageTitle("");
return (
<>
<HeroSection />

View File

@ -1,7 +1,10 @@
import Section from "../components/Section";
import { usePageTitle } from "../hooks";
import "./_404.css";
export function NotFound() {
usePageTitle("404");
return (
<Section title="404: Not Found" className="section-404">
The page you were looking for could not be found. Maybe it was deleted or the URL is incorrect.