Skip to content

Commit

Permalink
chore: moved head tags to config
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Mar 20, 2024
1 parent ed45695 commit 0266260
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 36 deletions.
26 changes: 20 additions & 6 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,29 @@ export default async () => {
},

head: [
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: `${baseUrl}/favicons/apple-touch-icon.png` }],
['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: `${baseUrl}/favicons/favicon-32x32.png` }],
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: `${baseUrl}/favicons/favicon-16x16.png` }],
['link', { rel: 'manifest', href: `${baseUrl}/favicons/site.webmanifest` }],
['link', { rel: 'mask-icon', href: `${baseUrl}/favicons/safari-pinned-tab.svg`, color: '#eaaf0c' }],
['link', { rel: 'shortcut icon', href: `${baseUrl}/favicons/favicon.ico` }],
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: `${baseUrl}favicons/apple-touch-icon.png` }],
['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: `${baseUrl}favicons/favicon-32x32.png` }],
['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: `${baseUrl}favicons/favicon-16x16.png` }],
['link', { rel: 'manifest', href: `${baseUrl}favicons/site.webmanifest` }],
['link', { rel: 'mask-icon', href: `${baseUrl}favicons/safari-pinned-tab.svg`, color: '#eaaf0c' }],
['link', { rel: 'shortcut icon', href: `${baseUrl}favicons/favicon.ico` }],
['meta', { name: 'msapplication-TileColor', content: '#2b5797' }],
['meta', { name: 'theme-color', content: '#ffffff' }],
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1' }],

['meta', { property: 'og:title', content: pkg.title }],
['meta', { property: 'og:description', content: pkg.description }],
['meta', { property: 'og:url', content: pkg.homepage }],
['meta', { property: 'og:image', content: `${baseUrl}og-image.png` }],
['meta', { property: 'og:site_name', content: pkg.title }],
['meta', { property: 'og:determiner', content: 'the' }],
['meta', { property: 'og:locale', content: 'en_US' }],
['meta', { property: 'og:type', content: 'website' }],

['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:site', content: '@nimiq' }],
['meta', { name: 'twitter:creator', content: '@nimiq' }],
['meta', { name: 'twitter:title', content: pkg.title }],
],
})
}
21 changes: 0 additions & 21 deletions .vitepress/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import VueDevTools from 'vite-plugin-vue-devtools'
import UnoCSS from 'unocss/vite'
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
import { postcssIsolateStyles } from 'vitepress'
import ogPlugin from 'vite-plugin-open-graph'
import { version } from '../package.json'
import { getGitStats } from './scripts/git-stats'
import { baseUrl, pkg } from './config'

export default defineConfig(async ({ mode }) => {
const environment = env.DEPLOYMENT_ENV || mode
Expand Down Expand Up @@ -74,25 +72,6 @@ export default defineConfig(async ({ mode }) => {
return { code: `@layer vp-base { ${code} }` }
},
},

ogPlugin({
basic: {
title: pkg.title,
description: pkg.description,
url: pkg.homepage,
image: `${baseUrl}og-image.png`,
siteName: pkg.title,
determiner: 'the',
locale: 'en_US',
type: 'website',
},
twitter: {
card: 'summary_large_image',
site: '@nimiq',
creator: '@nimiq',
title: pkg.title,
},
}),
],
resolve: {
alias: [
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"unplugin-vue-components": "^0.26.0",
"vite": "5.1.6",
"vite-plugin-image-optimizer": "^1.1.7",
"vite-plugin-open-graph": "^2.0.4",
"vite-plugin-vue-devtools": "7.0.17",
"vitepress": "1.0.0-rc.45"
},
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified public/og-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0266260

Please sign in to comment.