fix(oembed.sql): surface oembed data for pages

This commit is contained in:
Cory Dransfeldt 2025-05-25 20:21:44 -07:00
parent 9687509e4a
commit 9420ceee4f
No known key found for this signature in database
3 changed files with 12 additions and 3 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "8.0.0",
"version": "8.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "8.0.0",
"version": "8.0.1",
"license": "MIT",
"dependencies": {
"minisearch": "^7.1.2",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "8.0.0",
"version": "8.0.1",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {

View file

@ -9,6 +9,15 @@ WITH oembed_data AS (
p.date AS content_date
FROM optimized_posts p
UNION ALL
SELECT
'page' AS type,
pa.permalink::TEXT AS url,
pa.title AS title,
pa.description AS description,
COALESCE(NULLIF(pa.metadata->>'open_graph_image', ''), (SELECT metadata->>'open_graph_image' FROM optimized_globals LIMIT 1)) AS image_url,
NULL::timestamptz AS content_date
FROM optimized_pages pa
UNION ALL
SELECT
'book' AS type,
b.url::TEXT AS url,