meta.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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: "#202124",
  11. },
  12. social: {
  13. twitter: "@hoppscotch_io",
  14. },
  15. } as const
  16. export const META_TAGS = (env: Record<string, string>): IHTMLTag[] => [
  17. {
  18. name: "keywords",
  19. content: APP_INFO.keywords,
  20. },
  21. {
  22. name: "X-UA-Compatible",
  23. content: "IE=edge, chrome=1",
  24. },
  25. {
  26. name: "name",
  27. content: `${APP_INFO.name} • ${APP_INFO.shortDescription}`,
  28. },
  29. {
  30. name: "description",
  31. content: APP_INFO.description,
  32. },
  33. {
  34. name: "image",
  35. content: `${env.VITE_BASE_URL}/banner.png`,
  36. },
  37. // Open Graph tags
  38. {
  39. name: "og:title",
  40. content: `${APP_INFO.name} • ${APP_INFO.shortDescription}`,
  41. },
  42. {
  43. name: "og:description",
  44. content: APP_INFO.description,
  45. },
  46. {
  47. name: "og:image",
  48. content: `${env.VITE_BASE_URL}/banner.png`,
  49. },
  50. // Twitter tags
  51. {
  52. name: "twitter:card",
  53. content: "summary_large_image",
  54. },
  55. {
  56. name: "twitter:site",
  57. content: APP_INFO.social.twitter,
  58. },
  59. {
  60. name: "twitter:creator",
  61. content: APP_INFO.social.twitter,
  62. },
  63. {
  64. name: "twitter:title",
  65. content: `${APP_INFO.name} • ${APP_INFO.shortDescription}`,
  66. },
  67. {
  68. name: "twitter:description",
  69. content: APP_INFO.description,
  70. },
  71. {
  72. name: "twitter:image",
  73. content: `${env.VITE_BASE_URL}/banner.png`,
  74. },
  75. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  76. {
  77. name: "application-name",
  78. content: APP_INFO.name,
  79. },
  80. // Windows phone tile icon
  81. {
  82. name: "msapplication-TileImage",
  83. content: `${env.VITE_BASE_URL}/icon.png`,
  84. },
  85. {
  86. name: "msapplication-TileColor",
  87. content: APP_INFO.app.background,
  88. },
  89. {
  90. name: "msapplication-tap-highlight",
  91. content: "no",
  92. },
  93. // iOS Safari
  94. {
  95. name: "apple-mobile-web-app-title",
  96. content: APP_INFO.name,
  97. },
  98. {
  99. name: "apple-mobile-web-app-capable",
  100. content: "yes",
  101. },
  102. {
  103. name: "apple-mobile-web-app-status-bar-style",
  104. content: "black-translucent",
  105. },
  106. // PWA
  107. {
  108. name: "theme-color",
  109. content: APP_INFO.app.background,
  110. },
  111. {
  112. name: "mask-icon",
  113. content: "/icon.png",
  114. color: APP_INFO.app.background,
  115. },
  116. ]