Skip to content

Commit

Permalink
✨ Add dynamic page titles on frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelien-brabant committed Oct 16, 2023
1 parent 2ec74bd commit 4982b02
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/src/routes/chat/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
import RealtimeContext from "$lib/context/RealtimeContext.svelte";
import Chat from "$lib/components/chat/chat.svelte";
import AgentContext from "$lib/context/AgentContext.svelte";
import { mainContextStore } from "$lib/stores/main-context";
const projectName = $mainContextStore.publicProjectConfig?.name;
if (!projectName) {
throw new Error("Project name is not defined, this is not expected to happen!");
}
</script>

<svelte:head>
<title>Chat | {projectName}</title>
</svelte:head>

<AuthOnly>
<AgentContext>
<RealtimeContext>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
$: auth2Methods = projectConfig?.authMethods.filter((m) => m.type == "OAUTH2") ?? [];
</script>

<svelte:head>
<title>Sign In | {projectConfig.name}</title>
</svelte:head>

<div
class="flex min-h-screen items-center justify-center bg-background-primary dark:bg-background-primary-dark">
<ThemeSwitch />
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/routes/project-not-found/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import Typography from "$lib/components/common/typography/Typography.svelte";
</script>

<svelte:head>
<title>Not Found</title>
</svelte:head>

<div
class="min-h-screen flex items-center justify-center bg-background-primary dark:bg-background-primary-dark">
<div class="max-w-5xl">
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/routes/register/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
$: auth2Methods = projectConfig?.authMethods.filter((m) => m.type == "OAUTH2") ?? [];
</script>

<svelte:head>
<title>Sign Up | {projectConfig.name}</title>
</svelte:head>

<div
class="flex min-h-screen items-center justify-center bg-background-primary dark:bg-background-primary-dark">
<ThemeSwitch />
Expand Down

0 comments on commit 4982b02

Please sign in to comment.