socialHandle.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. package models
  2. // SocialHandle represents an external link.
  3. type SocialHandle struct {
  4. Platform string `yaml:"platform" json:"platform,omitempty"`
  5. URL string `yaml:"url" json:"url,omitempty"`
  6. Icon string `json:"icon,omitempty"`
  7. }
  8. // GetSocialHandle will return the details for a supported platform.
  9. func GetSocialHandle(platform string) *SocialHandle {
  10. allPlatforms := GetAllSocialHandles()
  11. if platform, ok := allPlatforms[platform]; ok {
  12. return &platform
  13. }
  14. return nil
  15. }
  16. // GetAllSocialHandles will return a list of all the social platforms we support.
  17. func GetAllSocialHandles() map[string]SocialHandle {
  18. socialHandlePlatforms := map[string]SocialHandle{
  19. "fediverse": {
  20. Platform: "Fediverse",
  21. Icon: "/img/platformlogos/fediverse.svg",
  22. },
  23. "matrix": {
  24. Platform: "Matrix",
  25. Icon: "/img/platformlogos/matrix.svg",
  26. },
  27. "xmpp": {
  28. Platform: "XMPP",
  29. Icon: "/img/platformlogos/xmpp.svg",
  30. },
  31. "bandcamp": {
  32. Platform: "Bandcamp",
  33. Icon: "/img/platformlogos/bandcamp.svg",
  34. },
  35. "discord": {
  36. Platform: "Discord",
  37. Icon: "/img/platformlogos/discord.svg",
  38. },
  39. "facebook": {
  40. Platform: "Facebook",
  41. Icon: "/img/platformlogos/facebook.svg",
  42. },
  43. "github": {
  44. Platform: "GitHub",
  45. Icon: "/img/platformlogos/github.svg",
  46. },
  47. "gitlab": {
  48. Platform: "GitLab",
  49. Icon: "/img/platformlogos/gitlab.svg",
  50. },
  51. "instagram": {
  52. Platform: "Instagram",
  53. Icon: "/img/platformlogos/instagram.svg",
  54. },
  55. "keyoxide": {
  56. Platform: "Keyoxide",
  57. Icon: "/img/platformlogos/keyoxide.png",
  58. },
  59. "kofi": {
  60. Platform: "Ko-Fi",
  61. Icon: "/img/platformlogos/ko-fi.svg",
  62. },
  63. "linkedin": {
  64. Platform: "LinkedIn",
  65. Icon: "/img/platformlogos/linkedin.svg",
  66. },
  67. "mastodon": {
  68. Platform: "Mastodon",
  69. Icon: "/img/platformlogos/mastodon.svg",
  70. },
  71. "patreon": {
  72. Platform: "Patreon",
  73. Icon: "/img/platformlogos/patreon.svg",
  74. },
  75. "paypal": {
  76. Platform: "Paypal",
  77. Icon: "/img/platformlogos/paypal.svg",
  78. },
  79. "snapchat": {
  80. Platform: "Snapchat",
  81. Icon: "/img/platformlogos/snapchat.svg",
  82. },
  83. "soundcloud": {
  84. Platform: "Soundcloud",
  85. Icon: "/img/platformlogos/soundcloud.svg",
  86. },
  87. "spotify": {
  88. Platform: "Spotify",
  89. Icon: "/img/platformlogos/spotify.svg",
  90. },
  91. "steam": {
  92. Platform: "Steam",
  93. Icon: "/img/platformlogos/steam.svg",
  94. },
  95. "tiktok": {
  96. Platform: "TikTok",
  97. Icon: "/img/platformlogos/tiktok.svg",
  98. },
  99. "twitch": {
  100. Platform: "Twitch",
  101. Icon: "/img/platformlogos/twitch.svg",
  102. },
  103. "twitter": {
  104. Platform: "X",
  105. Icon: "/img/platformlogos/twitter.svg",
  106. },
  107. "youtube": {
  108. Platform: "YouTube",
  109. Icon: "/img/platformlogos/youtube.svg",
  110. },
  111. "odysee": {
  112. Platform: "Odysee",
  113. Icon: "/img/platformlogos/odysee.svg",
  114. },
  115. "lbry": {
  116. Platform: "LBRY",
  117. Icon: "/img/platformlogos/lbry.svg",
  118. },
  119. "liberapay": {
  120. Platform: "LiberaPay",
  121. Icon: "/img/platformlogos/liberapay.svg",
  122. },
  123. "donate": {
  124. Platform: "Donations",
  125. Icon: "/img/platformlogos/donate.svg",
  126. },
  127. "follow": {
  128. Platform: "Follow",
  129. Icon: "/img/platformlogos/follow.svg",
  130. },
  131. }
  132. return socialHandlePlatforms
  133. }