Skip to content

Commit aadb206

Browse files
committed
use sqlpage.link in official blog
1 parent 07523cd commit aadb206

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

examples/official-site/blog.sql

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ SELECT 'list' AS component,
1010
SELECT title,
1111
description,
1212
icon,
13-
CASE
14-
WHEN external_url IS NOT NULL
15-
THEN external_url
16-
ELSE
17-
'?post=' || title
18-
END AS link
13+
sqlpage.link(
14+
COALESCE(external_url, ''),
15+
ifnull(external_url, json_object('post', title))
16+
) AS link
1917
FROM blog_posts
2018
ORDER BY created_at DESC;

0 commit comments

Comments
 (0)