Skip to content

Commit

Permalink
Change default title to i18n.global.t('title')
Browse files Browse the repository at this point in the history
  • Loading branch information
Elweyn committed Mar 26, 2024
1 parent 5246182 commit c12d5a7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion presenter/.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ PUBLIC_ENV__ENDPOINTS__GRAPHQL_URI=http://localhost:4000/
PUBLIC_ENV__META__BASE_URL="http://localhost:3000"
PUBLIC_ENV__META__DEFAULT_AUTHOR="DreamMall Verlag GbR"
PUBLIC_ENV__META__DEFAULT_DESCRIPTION="Deine Reichweite Erweitern Alle Möglichkeiten Miteinander Ausschöpfen Lebensqualität Leben"
PUBLIC_ENV__META__DEFAULT_TITLE="DreamMall"
3 changes: 2 additions & 1 deletion presenter/renderer/utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { PageContext } from 'vike/types'

import i18n from '#plugins/i18n'
import { META } from '#src/env'

function getTitle(pageContext: PageContext) {
// The value exported by /pages/**/+title.js is available at pageContext.config.title
const val = pageContext.config.title
if (typeof val === 'string') return val
if (typeof val === 'function') return String(val(pageContext))
return META.DEFAULT_TITLE
return i18n.global.t('title')
}
function getDescription(pageContext: PageContext) {
const val = pageContext.config.description
Expand Down
1 change: 0 additions & 1 deletion presenter/src/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe('env', () => {
DEFAULT_AUTHOR: 'DreamMall Verlag GbR',
DEFAULT_DESCRIPTION:
'Deine Reichweite Erweitern Alle Möglichkeiten Miteinander Ausschöpfen Lebensqualität Leben',
DEFAULT_TITLE: 'DreamMall',
})
})
})
1 change: 0 additions & 1 deletion presenter/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const META = {
'DreamMall Verlag GbR') as string,
DEFAULT_DESCRIPTION: (import.meta.env.PUBLIC_ENV__META__DEFAULT_DESCRIPTION ??
'Deine Reichweite Erweitern Alle Möglichkeiten Miteinander Ausschöpfen Lebensqualität Leben') as string,
DEFAULT_TITLE: (import.meta.env.PUBLIC_ENV__META__DEFAULT_TITLE ?? 'DreamMall') as string,
}

export { AUTH, ENDPOINTS, META }

0 comments on commit c12d5a7

Please sign in to comment.