diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 24f4165..3b30ff5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy to GitHub Pages on: push: branches: - - main # Trigger the action on pushes to the 'main' branch (adjust if your default branch is different) + - main jobs: build: @@ -16,17 +16,19 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '18' # Use the node version you're working with + node-version-file: '.nvmrc' + + - name: Install pnpm + run: npm install -g pnpm - name: Install dependencies - run: npm install + run: pnpm install - name: Build static site - run: npm run build && npm run export + run: pnpm build && pnpm export - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./out # This is the default export directory for Next.js static exports - # You can specify a 'cname' if you're using a custom domain + publish_dir: ./out diff --git a/app/blog/[slug]/page.tsx b/app/blog/[slug]/page.tsx index 4fcc86c..3a321f1 100644 --- a/app/blog/[slug]/page.tsx +++ b/app/blog/[slug]/page.tsx @@ -14,6 +14,7 @@ export async function generateStaticParams() { export function generateMetadata({ params }) { let post = getBlogPosts().find((post) => post.slug === params.slug) if (!post) { + // @ts-ignore return } @@ -23,9 +24,9 @@ export function generateMetadata({ params }) { summary: description, image, } = post.metadata - let ogImage = image - ? image - : `${baseUrl}/og?title=${encodeURIComponent(title)}` + // let ogImage = image + // ? image + // : `${baseUrl}/og?title=${encodeURIComponent(title)}` return { title, @@ -36,17 +37,17 @@ export function generateMetadata({ params }) { type: 'article', publishedTime, url: `${baseUrl}/blog/${post.slug}`, - images: [ - { - url: ogImage, - }, - ], + // images: [ + // { + // url: ogImage, + // }, + // ], }, twitter: { card: 'summary_large_image', title, description, - images: [ogImage], + images: [], }, } } @@ -71,9 +72,9 @@ export default function Blog({ params }) { datePublished: post.metadata.publishedAt, dateModified: post.metadata.publishedAt, description: post.metadata.summary, - image: post.metadata.image - ? `${baseUrl}${post.metadata.image}` - : `/og?title=${encodeURIComponent(post.metadata.title)}`, + // image: post.metadata.image + // ? `${baseUrl}${post.metadata.image}` + // : `/og?title=${encodeURIComponent(post.metadata.title)}`, url: `${baseUrl}/blog/${post.slug}`, author: { '@type': 'Person', diff --git a/app/og/route.tsx b/app/og/route.tsx deleted file mode 100644 index 82b9571..0000000 --- a/app/og/route.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { ImageResponse } from 'next/og' - -export function GET(request: Request) { - let url = new URL(request.url) - let title = url.searchParams.get('title') || 'Next.js Portfolio Starter' - - return new ImageResponse( - ( -
-
-

- {title} -

-
-
- ), - { - width: 1200, - height: 630, - } - ) -}