labrinth
labrinth copied to clipboard
Dynamic links for mods (outside of just issues, source, etc.)
Is your feature request related to a problem? Please describe. There are cases in which "Source", "Issues", "Discord", "Wiki", and donation links aren't enough.
Describe the solution you'd like
Thus, I would like to suggest that the existing foobar_url(s)
sections as a whole be turned into an array of user-defined names and links.
// Current
"icon_url": "https://cdn.modrinth.com/data/foobar/icon.png",
"issues_url": "https://github.com/foobar/foobar/issues",
"source_url": "https://github.com/foobar/foobar",
"wiki_url": null,
"discord_url": "https://discord.gg/foobar",
"donation_urls": ["https://paypal.me/modrinth"]
// Proposed
"icon_url": "https://cdn.modrinth.com/data/foobar/icon.png", // Leave this unchanged; not an actual "url"
"urls": [
"Issues (Fabric)": {
"url": "https://github.com/foobar/foobar-fabric/issues",
"icon": "<svg>"
},
"Issues (Forge)": {
"url": "https://github.com/foobar/foobar-forge/issues",
"icon": "<svg>"
},
"Source (Fabric)": {
"url": "https://github.com/foobar/foobar-fabric",
"icon": "<svg>"
},
"Source (Forge)": {
"url": "https://github.com/foobar/foobar-forge",
"icon": "<svg>"
},
"Discord": {
"url": "https://discord.gg/foobar",
"icon": "<svg>"
},
"Homepage": {
"url": "https://example.com",
"icon": "<svg>"
},
"PayPal": {
"url": "https://paypal.me/modrnith",
"icon": "<svg>"
]
}
Here's what the proposed would end up being rendered as:
Users would also probably have an option of a few pre-defined URLs with icons on the frontend, but that's an issue for the frontend, not here.
Possibly a better idea would be to have a drop-down list of URL types for mod owners to choose along with a "Custom" type with input for the title and id so the JSON would be easier to understand (also allow ordering via JSON arrays?)
"urls": [
{
"title": "Issues (Fabric)",
"id": "issues-fabric",
"url":"https://github.com/foobar/foobar-fabric/issues"
}
]
With the new way location for these types of links, this seems like it would be cleaner to do now
I feel like an aproach similar to donation links, where you define the URL and then what type it is could be useful.
You could then have pre-defined options like:
- Social:
- Discord
- Revolt
- Guilded
- IRC
- Issues (Report bugs)
- GitHub
- GitLab
- Codeberg
- Source
- GitHub
- GitLab
- Codeberg
The idea of pre-defined options is basically to avoid having the user to choose/find SVGs to use here, unless you would make it that they can choose from provided SVGs (Maybe Simple-icons support? Or just the ones you use/provide?).
To still allow more customization could a "Custom" option be provided which would then allow to define a custom SVG, Text and URL to use.
On another somewhat unrelated note: I feel like donation links should be put into their own section in the sidebar. Having them in the same section as with the other links can (and will) become quite cluttered if there are too many URLs provided, so a separation could be beneficial on the eyes.
I'm pretty sure the point of dynamic is to get rid of those fixed values.