-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #816 from dpc-sdp/feature/meta-refactor
[SDPAP-8228] Refactor PageLayout to call setup functions on hook
- Loading branch information
Showing
13 changed files
with
244 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export default defineNuxtPlugin((nuxtApp) => { | ||
nuxtApp.hook('tide:page', () => { | ||
useHead({ | ||
link: [ | ||
{ | ||
rel: 'apple-touch-icon', | ||
sizes: '180x180', | ||
href: '/apple-touch-icon.png' | ||
}, | ||
{ | ||
rel: 'icon', | ||
type: 'image/png', | ||
sizes: '32x32', | ||
href: '/favicon-32x32.png' | ||
}, | ||
{ | ||
rel: 'icon', | ||
type: 'image/png', | ||
sizes: '16x16', | ||
href: '/favicon-16x16.png' | ||
}, | ||
{ rel: 'manifest', href: '/site.webmanifest' }, | ||
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#0054c9' } | ||
], | ||
meta: [ | ||
{ name: 'msapplication-TileColor', content: '#0054c9' }, | ||
{ name: 'theme-color', content: '#ffffff' } | ||
] | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useAppConfig, useHead } from '#imports' | ||
import { defu as defuMerge } from 'defu' | ||
|
||
const formatThemeStyle = (themeObj) => { | ||
if (themeObj) { | ||
return Object.keys(themeObj) | ||
.map((key) => { | ||
return `--${key}: ${themeObj[key]}` | ||
}) | ||
.join(`;\r\n`) | ||
} | ||
} | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
nuxtApp.hook('tide:page', ({ site }) => { | ||
const siteTheme = defuMerge( | ||
site?.theme, | ||
useAppConfig()?.ripple?.theme || {} | ||
) | ||
const style = formatThemeStyle(siteTheme) | ||
if (style) { | ||
useHead({ | ||
style: [ | ||
{ | ||
children: `:root, body { ${style} }` | ||
} | ||
] | ||
}) | ||
} | ||
}) | ||
}) |
Oops, something went wrong.