Skip to content

Instantly share code, notes, and snippets.

@andrejsharapov
Created November 24, 2020 17:06
Show Gist options
  • Save andrejsharapov/d6f64c7cc963e0512afcb9953577f3e2 to your computer and use it in GitHub Desktop.
Save andrejsharapov/d6f64c7cc963e0512afcb9953577f3e2 to your computer and use it in GitHub Desktop.
OG and Schema meta tags for nuxt.config.js
export const meta = {
siteLang: 'ru-RU',
viewport:
'user-scalable=no, initial-scale = 1, minimum-scale = 1, maximum-scale = 1, width=device-width',
siteUrl: 'https://host_name',
siteName: 'site name',
keywords: '',
description: 'Open Source Portfolio of Ui/Ux Designer, Web Developer at GitHub',
author: 'Andrej Sharapov',
}
export const socmeta = {
appName: '@andrejsharapov',
locale: 'ru_RU',
}
export const fav = {
ico: '/favicon.ico',
ico16: '/favicons/favicon-16x16.png',
ico57: '/favicons/apple-touch-icon-57x57.png',
ico60: '/favicons/apple-touch-icon-60x60.png',
ico72: '/favicons/apple-touch-icon-72x72.png',
ico76: '/favicons/apple-touch-icon-76x76.png',
ico114: '/favicons/apple-touch-icon-114x114.png',
ico120: '/favicons/apple-touch-icon-120x120.png',
ico144: '/favicons/apple-touch-icon-144x144.png',
ico152: '/favicons/apple-touch-icon-152x152.png',
ico167: '/favicons/apple-touch-icon-167x167.png',
ico180: '/favicons/apple-touch-icon-180x180.png',
ico192: '/favicons/android-chrome-192x192.png',
}
export const colors = {
default: '#ffffff',
primary: '#16c1e9',
accent: '#4954de',
}
export default {
meta,
fav,
colors,
socmeta,
}
import appConfig from './config/app.config'
export default {
head: {
titleTemplate: `%s · ${appConfig.meta.siteName}`,
title: `${appConfig.meta.siteName}`,
htmlAttrs: {
lang: appConfig.meta.siteLang,
},
meta: [
{ charset: 'utf-8' },
{ name: 'author', content: appConfig.meta.siteName },
{ name: 'viewport', content: appConfig.meta.viewport },
{ name: 'keywords', hid: 'keywords', content: appConfig.meta.keywords },
{
name: 'description',
hid: 'description',
content: process.env.npm_package_description || '',
},
{ name: 'msapplication-TileColor', content: appConfig.colors.accent },
{ name: 'msapplication-TileImage', content: appConfig.fav.ico144 },
{ name: 'theme-color', content: appConfig.colors.default },
// { name: 'yandex-verification' , content: ''},
{ name: 'application-name', content: appConfig.socmeta.appName },
{ name: 'twitter:card', content: 'summary_large_image' },
// { name: 'twitter:title' , content: pageTitle + ' — ' + appConfig.meta.siteName},
{
name: 'twitter:description',
hid: 'description',
content: appConfig.meta.description,
},
{ name: 'twitter:url', content: appConfig.meta.siteUrl },
{ name: 'twitter:site', content: appConfig.socmeta.appName },
{ name: 'twitter:creator', content: appConfig.socmeta.appName },
{
name: 'twitter:image:src',
content: appConfig.meta.siteUrl + '/share.png',
},
{ name: 'og:image:width', property: 'og:image:width', content: '512' },
{ name: 'og:image:height', property: 'og:image:height', content: '512' },
{
name: 'og:image:type',
property: 'og:image:type',
content: 'image/png',
},
{ property: 'og:image', content: appConfig.meta.siteUrl + '/share.png' },
// { property: 'og:title' , content: pageTitle + ' — ' + appConfig.meta.siteName},
{
property: 'og:description',
hid: 'description',
content: appConfig.meta.description,
},
{ property: 'og:url', content: appConfig.meta.siteUrl },
{ property: 'og:site_name', content: appConfig.meta.siteName },
{ property: 'og:locale', content: appConfig.socmeta.locale },
{ property: 'og:type', content: 'website' },
],
link: [
{ rel: 'shortcut icon', href: appConfig.fav.ico, type: 'image/x-icon' },
{ rel: 'author', href: '/website.txt', type: 'text/plain' },
{ rel: 'manifest', href: '/favicons/site.webmanifest' },
{
rel: 'mask-icon',
href: '/favicons/safari-pinned-tab.svg',
color: appConfig.colors.primary,
},
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,300;0,400;0,500;0,600;0,800;0,900;1,300;1,400&family=Montserrat:ital,wght@0,300;0,400;0,500;0,700;1,300&display=swap',
},
{ rel: 'image_src', href: appConfig.meta.siteUrl + '/share.png' },
{ rel: 'dns-prefetch', href: 'https://fonts.googleapis.com' },
{ rel: 'dns-prefetch', href: 'https://cdn.jsdelivr.net' },
{ rel: 'dns-prefetch', href: 'https://www.google-analytics.com' },
],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment