djstevenson / songs-to-the-siren

A blog about songs
MIT License
0 stars 0 forks source link

Multiple uses for the same link #294

Closed djstevenson closed 4 years ago

djstevenson commented 4 years ago

We end up with similar links repeated, cos

Should allow one link record to serve multiple purposes.

e.g. Single YT link:

So, a single link can have TWO descriptions (inline and list).

If embedded, then we mangle the URL.

Single identifier...

e.g. ^^yt^^ uses 'yt' identifier inline, with the 'inline_description' If there is a list description, It appears in list with the list_description If you do ^^yt-embedded^^ it mangles the URL and embeds it

djstevenson commented 4 years ago

Current schema:

Column Embedded links? List links? Both
id SAME
song_id SAME
identifier YES
class YES
url DIFF
description DIFF
priority YES
extras YES
description DIFF
title Not used
css YES

"SAME" means used by embedded and list links, the same value used for both.

"DIFF" means used by embedded and list links, but we may want different values for each.

So, proposed new schema is:

Column Meaning
id Primary key
song_id belongs_to song
embed_identifier ^^identifier^^ for referring to this link in the article. Empty string if no embedded link required.
embed_class Perl class for rendering embedded links. Ignored if embed_identifier is empty
embed_url URL for embedded links. Ignored if embed_identifier is empty
embed_description Link text for embedded links. Ignored if embed_identifier is empty
list_priority Sort order for list links. Zero means "not in list"
list_description Link text for list links. Ignored if list_priority is 0
list_url URL for list links. Ignored if list_priority is 0
list_css CSS class / icon name for list links. Ignored if list_priority is 0

title, extras are dropped until we have a use-case for them.