Skip to content

Commit

Permalink
chore(setup): remove og
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcaldas committed Sep 21, 2024
1 parent 9612276 commit f30a2bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 40 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
25 changes: 13 additions & 12 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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,
Expand All @@ -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: [],
},
}
}
Expand All @@ -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',
Expand Down
22 changes: 0 additions & 22 deletions app/og/route.tsx

This file was deleted.

0 comments on commit f30a2bd

Please sign in to comment.