feat: dynamic pages to sitemap
This commit is contained in:
parent
b208b20186
commit
308562dc7a
9 changed files with 10064 additions and 67 deletions
|
@ -78,7 +78,11 @@ json_build_object('title', CONCAT(b.title, ' by ', b.author), 'image', CONCAT('/
|
|||
END) AS grid,
|
||||
CASE WHEN LOWER(b.read_status) = 'finished'
|
||||
AND b.star_rating IS NOT NULL THEN
|
||||
json_build_object('title', b.title, 'url', CONCAT('https://coryd.dev', b.slug), 'date', b.date_finished, 'description', CASE WHEN b.review IS NOT NULL THEN
|
||||
json_build_object('title', CONCAT(b.title, 'by ', b.author, CASE WHEN b.star_rating IS NOT NULL THEN
|
||||
CONCAT(' (', b.star_rating, ')')
|
||||
ELSE
|
||||
''
|
||||
END), 'url', CONCAT('https://coryd.dev', b.slug), 'date', b.date_finished, 'description', CASE WHEN b.review IS NOT NULL THEN
|
||||
b.review
|
||||
ELSE
|
||||
b.description
|
||||
|
|
|
@ -83,7 +83,11 @@ WHERE
|
|||
r.movies_id = m.id) AS related_movies,
|
||||
CASE WHEN m.star_rating IS NOT NULL
|
||||
AND m.last_watched IS NOT NULL THEN
|
||||
json_build_object('title', m.title, 'url', CONCAT('https://coryd.dev', m.slug), 'date', m.last_watched, 'description', CASE WHEN m.review IS NOT NULL THEN
|
||||
json_build_object('title', CONCAT(m.title, CASE WHEN m.star_rating IS NOT NULL THEN
|
||||
CONCAT(' (', m.star_rating, ')')
|
||||
ELSE
|
||||
''
|
||||
END), 'url', CONCAT('https://coryd.dev', m.slug), 'date', m.last_watched, 'description', CASE WHEN m.review IS NOT NULL THEN
|
||||
m.review
|
||||
ELSE
|
||||
m.description
|
||||
|
|
|
@ -3,7 +3,7 @@ SELECT
|
|||
ar.name_string AS name,
|
||||
ar.slug AS url,
|
||||
ar.tentative,
|
||||
to_char(ar.total_plays, 'FM999,999,999,999') AS total_plays, -- Format total_plays with commas
|
||||
to_char(ar.total_plays, 'FM999,999,999,999') AS total_plays,
|
||||
ar.country,
|
||||
ar.description,
|
||||
ar.favorite,
|
||||
|
@ -14,12 +14,12 @@ SELECT
|
|||
ar.emoji,
|
||||
ar.tattoo,
|
||||
CONCAT('/', df.filename_disk) AS image,
|
||||
json_build_object('alt', CONCAT(to_char(ar.total_plays, 'FM999,999,999,999'), ' plays of ', ar.name_string), -- Format total_plays in alt text
|
||||
'subtext', CONCAT(to_char(ar.total_plays, 'FM999,999,999,999'), ' plays') -- Format total_plays in subtext
|
||||
json_build_object('alt', CONCAT(to_char(ar.total_plays, 'FM999,999,999,999'), ' plays of ', ar.name_string),
|
||||
'subtext', CONCAT(to_char(ar.total_plays, 'FM999,999,999,999'), ' plays')
|
||||
) AS grid,
|
||||
(
|
||||
SELECT
|
||||
json_agg(json_build_object('name', a.name, 'release_year', a.release_year, 'total_plays', to_char(a.total_plays, 'FM999,999,999,999'), -- Format total_plays here as well
|
||||
json_agg(json_build_object('name', a.name, 'release_year', a.release_year, 'total_plays', to_char(a.total_plays, 'FM999,999,999,999'),
|
||||
'art', df_album.filename_disk)
|
||||
ORDER BY a.release_year)
|
||||
FROM
|
||||
|
|
Reference in a new issue