mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
feat(website): adjust page title
This commit is contained in:
parent
5e07231d78
commit
4e4e65b462
11
apps/website/src/hooks.tsx
Normal file
11
apps/website/src/hooks.tsx
Normal 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 ]);
|
||||
}
|
@ -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">
|
||||
|
@ -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 (
|
||||
<>
|
||||
|
@ -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 />
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user