Skip to content

Commit 09b84eb

Browse files
committed
Add og images for blog entries
1 parent 1660d14 commit 09b84eb

13 files changed

Lines changed: 213 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ jobs:
1919
with:
2020
node-version: 24
2121
cache: "pnpm"
22+
- name: Restore generated image cache
23+
uses: actions/cache@v4
24+
with:
25+
path: .astro/og-cache
26+
key: ${{ runner.os }}-og-images-${{ hashFiles('src/pages/og/**', 'src/content/blog/**', 'src/content/authors/**', 'src/content/projects/**', 'public/logos/**', 'pnpm-lock.yaml') }}
27+
restore-keys: |
28+
${{ runner.os }}-og-images-
2229
- name: Install dependencies
2330
run: pnpm install
2431
- name: Build

src/components/BaseHead.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const imageURL = image ? new URL(image, Astro.site) : undefined;
5252
<meta property="og:title" content={title} />
5353
<meta property="og:description" content={description} />
5454
{imageURL && <meta property="og:image" content={imageURL} />}
55+
{imageURL && <meta property="og:image:width" content="1200" />}
56+
{imageURL && <meta property="og:image:height" content="630" />}
5557
{imageURL && <meta property="og:image:alt" content={title} />}
5658
{publishedTime && <meta property="article:published_time" content={publishedTime.toISOString()} />}
5759
{modifiedTime && <meta property="article:modified_time" content={modifiedTime.toISOString()} />}

src/content.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const projects = defineCollection({
3030
translation: z.string().optional(),
3131
unlisted: z.boolean().default(false),
3232
logo: z.string().optional(),
33+
color: z
34+
.string()
35+
.regex(/^#[0-9A-Fa-f]{6}$/)
36+
.optional(),
3337
order: z.number().optional(),
3438
}),
3539
});

src/content/projects/butterfly.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"description": "🎨 Powerful, minimalistic, cross-platform, opensource note-taking app",
55
"website": "https://docs.butterfly.linwood.dev",
66
"translation": "https://translate.linwood.dev/butterfly/",
7+
"color": "#EBB733",
78
"order": 1
89
}

src/content/projects/dev-doctor.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"source": "https://github.com/LinwoodDev/dev_doctor",
44
"description": "Free, opensource, serverless learning platform",
55
"website": "https://docs.dev-doctor.linwood.dev",
6+
"color": "#5C3070",
67
"unlisted": true
78
}

src/content/projects/flow.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"source": "https://github.com/LinwoodDev/Flow",
44
"description": "WIP: Feature rich event, group and time managment system",
55
"website": "https://docs.flow.linwood.dev",
6+
"color": "#35CDEF",
67
"order": 2
78
}

src/content/projects/launcher.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"source": "https://github.com/LinwoodDev/Launcher",
44
"description": "WIP: 🚀 A simple, minimalistic, cross-platform, opensource launcher",
55
"website": "https://docs.launch.linwood.dev",
6+
"color": "#2196F3",
67
"unlisted": true
78
}

src/content/projects/luna.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"description": "WIP: Library for Universal Networking Assets",
55
"website": "https://luna.linwood.dev",
66
"logo": "luna",
7+
"color": "#D9C38B",
78
"order": 5
89
}

src/content/projects/setonix.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"source": "https://github.com/LinwoodDev/Setonix",
44
"description": "WIP: Powerful, customizable, cross-platform, opensource table sandbox game",
55
"website": "https://setonix.world",
6+
"color": "#B46B43",
67
"order": 3
78
}

src/content/projects/swamp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"source": "https://github.com/LinwoodDev/Swamp",
44
"description": "WIP: Universal Secure Web-Socket Application Messaging Proxy for Linwood Apps",
55
"website": "https://swamp.linwood.dev",
6+
"color": "#4D55D8",
67
"order": 4
78
}

0 commit comments

Comments
 (0)