Skip to content

Commit

Permalink
Fix page titles
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebrooker committed Mar 15, 2024
1 parent 349ae67 commit ca7db52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ apps/kitchen-sink/ios

.tamagui

.obsidian

.idea

.env
Expand Down
2 changes: 1 addition & 1 deletion src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default function RootLayout () {

const colorScheme = 'light'
const pathname = usePathname()
const currentPath = getCurrentPath(pathname, false)

const currentPath = getCurrentPath(pathname)
const {
image = {},
title = site.title,
Expand Down
5 changes: 3 additions & 2 deletions src/utils/getCurrentPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export function ensureSlash (inputPath: string, needsSlash: boolean): string {
}
}

export const getCurrentPath = (pathname: string) =>
ensureSlash(pathname || '', true) || 'home'
export const getCurrentPath = (pathname: string, needsSlash: boolean = true) =>
ensureSlash(pathname || '', needsSlash) || 'home'

0 comments on commit ca7db52

Please sign in to comment.