From 63fdd4b5fc97f76de259e698a618d5456feb4c8a Mon Sep 17 00:00:00 2001 From: arzafran Date: Wed, 17 Apr 2024 15:58:27 -0300 Subject: [PATCH 1/8] saucy og --- .env.example | 18 +- .husky/pre-commit | 2 +- app/(pages)/layout.js | 59 +- app/(pages)/storyblok/page.js | 1 - app/apple-icon.js | 38 + app/apple-icon.png | Bin 1148 -> 0 bytes app/favicon.ico | Bin 4158 -> 0 bytes app/icon.js | 38 + app/icon.png | Bin 6275 -> 0 bytes app/manifest.js | 32 + app/opengraph-image.js | 93 ++ app/opengraph-image.png | Bin 24869 -> 0 bytes app/robots.js | 2 +- app/sitemap.js | 34 + app/sw.js | 12 + components/google-tag-manager/index.js | 39 - jsconfig.json | 2 +- next-sitemap.config.js | 4 - next.config.js | 46 +- package.json | 38 +- pnpm-lock.yaml | 1216 +++++++++++------------- public/admin/.gitignore | 2 - public/images/placeholder.webp | Bin 3522 -> 0 bytes public/robots.txt | 9 - public/sitemap.xml | 4 - public/sw.js | 336 +++++++ public/swe-worker-development.js | 102 ++ 27 files changed, 1345 insertions(+), 782 deletions(-) create mode 100644 app/apple-icon.js delete mode 100644 app/apple-icon.png delete mode 100644 app/favicon.ico create mode 100644 app/icon.js delete mode 100644 app/icon.png create mode 100644 app/manifest.js create mode 100644 app/opengraph-image.js delete mode 100644 app/opengraph-image.png create mode 100644 app/sitemap.js create mode 100644 app/sw.js delete mode 100644 components/google-tag-manager/index.js delete mode 100644 next-sitemap.config.js delete mode 100644 public/admin/.gitignore delete mode 100644 public/images/placeholder.webp delete mode 100644 public/robots.txt delete mode 100644 public/sitemap.xml create mode 100644 public/sw.js create mode 100644 public/swe-worker-development.js diff --git a/.env.example b/.env.example index b687b00d..77816041 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,12 @@ -STORYBLOK_PUBLIC_ACCESS_TOKEN="" -STORYBLOK_PREVIEW_ACCESS_TOKEN="" -SHOPIFY_STOREFRONT_ACCESS_TOKEN="" -SHOPIFY_STORE_DOMAIN="" -NEXT_PUBLIC_HUSBPOT_PORTAL_ID="" -NEXT_HUSBPOT_FORM_ID="" -HUBSPOT_ACCESS_TOKEN="" DRAFT_MODE_TOKEN="" +GSAP_AUTH_TOKEN="" +HUBSPOT_ACCESS_TOKEN="" +NEXT_HUSBPOT_FORM_ID="" NEXT_PUBLIC_BASE_URL="" -GSAP_AUTH_TOKEN="" \ No newline at end of file +NEXT_PUBLIC_HUSBPOT_PORTAL_ID="" +SHOPIFY_STOREFRONT_ACCESS_TOKEN="" +SHOPIFY_STORE_DOMAIN="" +STORYBLOK_PREVIEW_ACCESS_TOKEN="" +STORYBLOK_PUBLIC_ACCESS_TOKEN="" +NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID="" +NEXT_PUBLIC_GOOGLE_ANALYTICS="" \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af2198..c37466e2 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged +npx lint-staged \ No newline at end of file diff --git a/app/(pages)/layout.js b/app/(pages)/layout.js index b453827a..ee329ef7 100644 --- a/app/(pages)/layout.js +++ b/app/(pages)/layout.js @@ -1,30 +1,79 @@ +import { GoogleAnalytics, GoogleTagManager } from '@next/third-parties/google' import { Debug } from 'components/debug' -import { GoogleTagManager } from 'components/google-tag-manager' import { GSAP } from 'components/gsap' import { RealViewport } from 'components/real-viewport' import { StyleVariables } from 'libs/style-variables' import { colors, themes } from 'styles/config' +import AppData from '../../package.json' + import 'styles/global.scss' import { fonts } from '../fonts' +const APP_NAME = AppData.name +const APP_DEFAULT_TITLE = 'Satūs' +const APP_TITLE_TEMPLATE = '%s - Satūs' +const APP_DESCRIPTION = AppData.description +const APP_BASE_URL = process.env.NEXT_PUBLIC_BASE_URL + +const GTM_ID = process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID || false +const GA_ID = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || false + export const metadata = { - title: 'Satūs', - description: 'Next.js starter', + metadataBase: + process.env.NODE_ENV === 'dev' + ? new URL(`http://localhost:${process.env.PORT || 3000}`) + : new URL(APP_BASE_URL), + applicationName: APP_NAME, + title: { + default: APP_DEFAULT_TITLE, + template: APP_TITLE_TEMPLATE, + }, + description: APP_DESCRIPTION, + appleWebApp: { + capable: true, + statusBarStyle: 'default', + title: APP_DEFAULT_TITLE, + }, + formatDetection: { + telephone: false, + }, + openGraph: { + type: 'website', + siteName: APP_NAME, + title: { + default: APP_DEFAULT_TITLE, + template: APP_TITLE_TEMPLATE, + }, + description: APP_DESCRIPTION, + }, + twitter: { + card: 'summary', + title: { + default: APP_DEFAULT_TITLE, + template: APP_TITLE_TEMPLATE, + }, + description: APP_DESCRIPTION, + }, +} + +export const viewport = { + themeColor: '#e30613', } export default async function Layout({ children }) { return ( - + + {GTM_ID && } {children} - + {GA_ID && } ) } diff --git a/app/(pages)/storyblok/page.js b/app/(pages)/storyblok/page.js index c50bf409..f39dca61 100644 --- a/app/(pages)/storyblok/page.js +++ b/app/(pages)/storyblok/page.js @@ -36,7 +36,6 @@ export default async function Storyblok() { } // https://nextjs.org/docs/app/api-reference/functions/generate-metadata - export async function generateMetadata({}) { const isDraftMode = draftMode().isEnabled || process.env.NODE_ENV === 'development' diff --git a/app/apple-icon.js b/app/apple-icon.js new file mode 100644 index 00000000..31ec632d --- /dev/null +++ b/app/apple-icon.js @@ -0,0 +1,38 @@ +import { ImageResponse } from 'next/og' +import { themes } from 'styles/config.js' + +// Image metadata +export const size = { + width: 192, + height: 192, +} +export const contentType = 'image/png' + +// Image generation +// function can receive {params} prop to access dynamic route params +export default function Icon() { + return new ImageResponse( + ( +
+ DE +
+ ), + // ImageResponse options + { + // For convenience, we can re-use the exported icons size metadata + // config to also set the ImageResponse's width and height. + ...size, + }, + ) +} diff --git a/app/apple-icon.png b/app/apple-icon.png deleted file mode 100644 index 9486a18b81f790303f03d2d5ceb8efe70f5483d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1148 zcmcIk{Yw*Z9R6;*Znw3qo3q%a*tv!ZWgP0tLTuB^CX6zR)JmFBmL+8`KiC`Hrlm!} zEP@$EMKp*)?FB-Ma#~R^LVBSBDKn7@ir#+cjq3UAf9Qw1gXcc?eV)(rc|LcjV(}ug z(P?Cinall3C7uIx2|VtVBaM1I3{C!;9gI!3(WPN0yX=f{v&$9V^5(7&BbUuXvdH-s zZ3_PC`DpA|)l{$TQu{uy>{kAqUa)6(uIKrA&-dTI^wpc>G{z~BxlCve7KglEZk|q6 zg$dE5b=}Vu0e1U*UhW-%F)Oci`LpeuBA*i_DV)%TRH5E(!RHMXq8L9?+M)`_^h{$7 zNIXErj?Y~ks9YDu86}^k=B+)U{Raw1Gpk=Psnw=~T93G6&F;1Mnw- z1%nXv*uZP7>r%C#zUl>N8X{_EDpNnUxgjPC;d7Pz;z`$9%(2J)e3+ zeGxYktvq;n?xQ`@FvS<3SS6S6bb$P{GX{~YFlu7LR0jDMn&NJyjMF#usorOQg$zZpr)4C#5UX(PrD$CCGIEA|{ zqkT92H*J*WDs}iF5ObA1;$gk7>e;~UlJrmFrA8(`7rye4IBtVw@&*Ro7V@!g5*#0= zk;(fAbk#em9yEW~)E>Fs;x z_o{YXM)(ABlvekWYWGqmCrp&9ObY6Ca(p$7EH(w8e})O*sUWDzGKne~HaQ(sG0M54 z4PyypPy)OrfGH$Wagpr?KK{g;lfl*2>i!zH4V3m?(RhP163OjZ0`2iG%GEq-Xd;=G z&9oEW2yAGDsF;mbDu=_V^&xvGfSgNjhQacHRxG7m1AZ4oM*MD6=EbEbjrGjM z&7*5FEzQD;IZSA5-9@!u3|N$CKIN(n4aG;O_3h+cw3xu7GQgd*QjP^lrg5iH{KSr1U diff --git a/app/favicon.ico b/app/favicon.ico deleted file mode 100644 index 304aca44264270b03a7b1a0eb3be7b58ea533ed8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4158 zcmeIwu?@f=3`EhNh8ignH6>$Y|1}sS9F!R$`nJx6-B}N=bnooRsL+6sWW|&0{i)o( eb(i@Xf1m*kXg~uR(0~RspaBhNKm!{1w}Ay#h3(V; diff --git a/app/icon.js b/app/icon.js new file mode 100644 index 00000000..c41c235e --- /dev/null +++ b/app/icon.js @@ -0,0 +1,38 @@ +import { ImageResponse } from 'next/og' +import { themes } from 'styles/config.js' + +// Image metadata +export const size = { + width: 512, + height: 512, +} +export const contentType = 'image/png' + +// Image generation +// function can receive {params} prop to access dynamic route params +export default function Icon() { + return new ImageResponse( + ( +
+ DE +
+ ), + // ImageResponse options + { + // For convenience, we can re-use the exported icons size metadata + // config to also set the ImageResponse's width and height. + ...size, + }, + ) +} diff --git a/app/icon.png b/app/icon.png deleted file mode 100644 index 898c42b0bab063fd39fb6bcbb9bf581ec3a656c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6275 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&zE~)R&4Yzkn2Hfk$L90|U1(2s1Lwnj^u$ zAYtn1;uumf=k1-1yfKD6E{^Wk8Gf&SC;DmbZbt4KoKxg~JQr(ndF8+Vw~lE-10$P6 z!h>a5AD-9$XYl5g01H@1GjOmlGV>T5U|@dE!ocJRq=B3RJDD0B1VDm31_f0N3IZ%( z6+Cm)9N@~+xe&@FnOmUBm$2PqglRR2VCHAE{U8Xn`~(|ZgM%N!%qIwQ9FVM9!YKfA zjl(j8>J%QBaKUHO4}1(PpX-@`{%UAs%T8eaaKL@T6|g@Qko;u{caXsZZG?AUA_*gT zYbL_y6AWR#J#hB=0c!? zVP)_E$+8cKF#K}`WElsc|M@I@XL!$yDE)~>aiWu37SP{au2;oaC z9B|da2w@{OnDCCDQWfkBO+W3yX~3b`bOU3>1LcS;aLiBOWngIn2WJB#l3jM;2$SrP zEVJ`%fI6Cy%?`;nyJVPn<9v{9&}jW|do_unxCE~EfWs^XMOdOtK}tZ!;KJtd%KI>{(Q?C&C8JTc{DErn<^Am%|j$F zCtPeGt;sP&{54vsz?w0m5k}`qWrUO*qd9Cehw%)}Zu4l7I9ep~7>xF0!Gmu|V@1>( sm>SJtqd9Cehd~FxM?wz!8{E9VQ>E diff --git a/app/manifest.js b/app/manifest.js new file mode 100644 index 00000000..07998759 --- /dev/null +++ b/app/manifest.js @@ -0,0 +1,32 @@ +import { themes } from 'styles/config.js' +import AppData from '../package.json' + +export default function manifest() { + return { + name: AppData.name, + short_name: AppData.name, + description: AppData.description, + start_url: '/', + display: 'standalone', + background_color: themes.red.primary, + theme_color: themes.red.contrast, + icons: [ + { + src: '/icon', + sizes: 'any', + type: 'image/png', + }, + { + src: '/icon', + sizes: '512x512', + type: 'image/png', + }, + { + src: '/apple-icon', + sizes: '192x192', + type: 'image/png', + purpose: 'any', + }, + ], + } +} diff --git a/app/opengraph-image.js b/app/opengraph-image.js new file mode 100644 index 00000000..ab87f214 --- /dev/null +++ b/app/opengraph-image.js @@ -0,0 +1,93 @@ +import { ImageResponse } from 'next/og' +import { themes } from 'styles/config.js' +import AppData from '../package.json' + +// Image metadata +export const alt = AppData.name +export const size = { + width: 1200, + height: 630, +} + +export const contentType = 'image/png' + +// Image generation +export default async function Image() { + // Font + const ibmPlexMono = fetch( + new URL('fonts/IBM_Plex_Mono/IBMPlexMono-Regular.woff2', import.meta.url), + ).then((res) => res.arrayBuffer()) + + return new ImageResponse( + ( + // ImageResponse JSX element +
+
+
+
darkroom.engineering
+
+
+ {AppData.name} +
+
+
where things get developed
+
hi@darkroom.engineering
+
+
+
+ ), + // ImageResponse options + { + ...size, + fonts: [ + { + name: 'IBM_Plex_Mono', + data: await ibmPlexMono, + style: 'normal', + weight: 400, + }, + ], + }, + ) +} diff --git a/app/opengraph-image.png b/app/opengraph-image.png deleted file mode 100644 index fc298075242841b5406331a27e2eae4a19821ada..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24869 zcmeIac~p{H_%^J~W#uVz$f3bX%Q4G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index 84f5c446..06ef34bb 100644 --- a/app/robots.js +++ b/app/robots.js @@ -3,7 +3,7 @@ export default function robots() { rules: { userAgent: '*', allow: '/', - disallow: ['/private/', '/debug/'], + disallow: '/private/', }, sitemap: `${process.env.NEXT_PUBLIC_BASE_URL}/sitemap.xml`, } diff --git a/app/sitemap.js b/app/sitemap.js new file mode 100644 index 00000000..43413fd4 --- /dev/null +++ b/app/sitemap.js @@ -0,0 +1,34 @@ +import fs from 'fs' +import path from 'path' + +export default function sitemap() { + const appDirectory = path.join(process.cwd(), 'app/(pages)') + const folders = fs + .readdirSync(appDirectory, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => dirent.name) + .filter((folderName) => !/^\(.*\)$/.test(folderName)) + + const sitemapArray = [ + { + url: `${process.env.NEXT_PUBLIC_BASE_URL}`, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 1, + }, + ...folders + .filter((folder) => { + return fs.existsSync(path.join(appDirectory, folder, 'page.js')) + }) + .map((folder) => { + return { + url: `${process.env.NEXT_PUBLIC_BASE_URL}/${folder}`, + lastModified: new Date(), + changeFrequency: 'weekly', + priority: 0.8, + } + }), + ] + + return sitemapArray +} diff --git a/app/sw.js b/app/sw.js new file mode 100644 index 00000000..adf9948e --- /dev/null +++ b/app/sw.js @@ -0,0 +1,12 @@ +import { defaultCache } from '@serwist/next/worker' +import { Serwist } from 'serwist' + +const serwist = new Serwist({ + precacheEntries: self.__SW_MANIFEST, + skipWaiting: true, + clientsClaim: true, + navigationPreload: true, + runtimeCaching: defaultCache, +}) + +serwist.addEventListeners() diff --git a/components/google-tag-manager/index.js b/components/google-tag-manager/index.js deleted file mode 100644 index 41f4bb94..00000000 --- a/components/google-tag-manager/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use client' - -/* eslint-disable no-unused-vars */ - -import Script from 'next/script' - -const GTM_ID = process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID || '' -const GA_ID = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || '' - -const pageview = (url) => { - window.dataLayer.push({ - event: 'pageview', - page: url, - }) -} - -export function GoogleTagManager() { - if (process.env.NODE_ENV === 'development') return null - - return ( - <> -