feat(*): refactor metadata handling; move metadata to backend where possible, refine client views
This commit is contained in:
parent
929bc9f9f8
commit
9687509e4a
35 changed files with 506 additions and 339 deletions
|
@ -5,11 +5,24 @@ SELECT
|
|||
p.permalink,
|
||||
p.description,
|
||||
json_build_object(
|
||||
'title', CONCAT(p.title, ' • ', globals.site_name),
|
||||
'description', LEFT(
|
||||
regexp_replace(
|
||||
regexp_replace(
|
||||
regexp_replace(p.description, E'[*_`~#>-]', '', 'g'),
|
||||
E'\\[(.*?)\\]\\((.*?)\\)', '\\1', 'g'
|
||||
),
|
||||
E'!\\[(.*?)\\]\\((.*?)\\)', '', 'g'
|
||||
),
|
||||
250
|
||||
),
|
||||
'open_graph_image', CASE
|
||||
WHEN df.filename_disk IS NOT NULL AND df.filename_disk != '' AND df.filename_disk != '/' THEN
|
||||
CONCAT('/', df.filename_disk)
|
||||
ELSE NULL
|
||||
END
|
||||
ELSE globals.metadata->>'open_graph_image'
|
||||
END,
|
||||
'url', CONCAT(globals.url, p.permalink),
|
||||
'type', 'page'
|
||||
) AS metadata,
|
||||
p.updated,
|
||||
(
|
||||
|
@ -62,4 +75,7 @@ FROM
|
|||
GROUP BY
|
||||
p.id,
|
||||
df.filename_disk,
|
||||
globals.cdn_url;
|
||||
globals.cdn_url,
|
||||
globals.site_name,
|
||||
globals.url,
|
||||
globals.metadata->>'open_graph_image';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue