meta.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. import { IHTMLTag } from "vite-plugin-html-config"
  2. export const APP_INFO = {
  3. name: "Hoppscotch",
  4. shortDescription: "Open source API development ecosystem",
  5. description:
  6. "Helps you create requests faster, saving precious time on development.",
  7. keywords:
  8. "hoppscotch, hopp scotch, hoppscotch online, hoppscotch app, postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket, sse, graphql, socketio",
  9. app: {
  10. background: "#181818",
  11. lightThemeColor: "#ffffff",
  12. darkThemeColor: "#181818",
  13. },
  14. social: {
  15. twitter: "@hoppscotch_io",
  16. },
  17. } as const
  18. export const META_TAGS = (env: Record<string, string>): IHTMLTag[] => [
  19. {
  20. name: "keywords",
  21. content: APP_INFO.keywords,
  22. },
  23. {
  24. name: "X-UA-Compatible",
  25. content: "IE=edge, chrome=1",
  26. },
  27. {
  28. name: "name",
  29. content: `${APP_INFO.name} • ${APP_INFO.shortDescription}`,
  30. },
  31. {
  32. name: "description",
  33. content: APP_INFO.description,
  34. },
  35. {
  36. name: "image",
  37. content: `${env.VITE_BASE_URL}/banner.png`,
  38. },
  39. // Open Graph tags
  40. {
  41. name: "og:title",
  42. content: `${APP_INFO.name} • ${APP_INFO.shortDescription}`,
  43. },
  44. {
  45. name: "og:description",
  46. content: APP_INFO.description,
  47. },
  48. {
  49. name: "og:image",
  50. content: `${env.VITE_BASE_URL}/banner.png`,
  51. },
  52. // Twitter tags
  53. {
  54. name: "twitter:card",
  55. content: "summary_large_image",
  56. },
  57. {
  58. name: "twitter:site",
  59. content: APP_INFO.social.twitter,
  60. },
  61. {
  62. name: "twitter:creator",
  63. content: APP_INFO.social.twitter,
  64. },
  65. {
  66. name: "twitter:title",
  67. content: `${APP_INFO.name} • ${APP_INFO.shortDescription}`,
  68. },
  69. {
  70. name: "twitter:description",
  71. content: APP_INFO.description,
  72. },
  73. {
  74. name: "twitter:image",
  75. content: `${env.VITE_BASE_URL}/banner.png`,
  76. },
  77. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  78. {
  79. name: "application-name",
  80. content: APP_INFO.name,
  81. },
  82. // Windows phone tile icon
  83. {
  84. name: "msapplication-TileImage",
  85. content: `${env.VITE_BASE_URL}/icon.png`,
  86. },
  87. {
  88. name: "msapplication-TileColor",
  89. content: APP_INFO.app.background,
  90. },
  91. {
  92. name: "msapplication-tap-highlight",
  93. content: "no",
  94. },
  95. // iOS Safari
  96. {
  97. name: "apple-mobile-web-app-title",
  98. content: APP_INFO.name,
  99. },
  100. {
  101. name: "apple-mobile-web-app-capable",
  102. content: "yes",
  103. },
  104. {
  105. name: "apple-mobile-web-app-status-bar-style",
  106. content: "black-translucent",
  107. },
  108. // PWA
  109. {
  110. name: "theme-color",
  111. content: APP_INFO.app.darkThemeColor,
  112. media: "(prefers-color-scheme: dark)",
  113. },
  114. {
  115. name: "theme-color",
  116. content: APP_INFO.app.lightThemeColor,
  117. media: "(prefers-color-scheme: light)",
  118. },
  119. {
  120. name: "supported-color-schemes",
  121. content: "light dark",
  122. },
  123. {
  124. name: "mask-icon",
  125. content: "/icon.png",
  126. color: APP_INFO.app.background,
  127. },
  128. ]