tg-blog 1.0.11 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +56 -0
  2. package/dist/{Location-d7867b06.js → Location-038d6bfe.js} +1576 -1544
  3. package/dist/Location-038d6bfe.js.map +1 -0
  4. package/dist/{Location-cbb3b437.cjs → Location-26030a74.cjs} +3 -3
  5. package/dist/{Location-d7867b06.js.map → Location-26030a74.cjs.map} +1 -1
  6. package/dist/{Poll-16a454bd.cjs → Poll-37190a20.cjs} +2 -2
  7. package/dist/{Poll-16a454bd.cjs.map → Poll-37190a20.cjs.map} +1 -1
  8. package/dist/{Poll-e903e06f.js → Poll-7f9be6c7.js} +2 -2
  9. package/dist/{Poll-e903e06f.js.map → Poll-7f9be6c7.js.map} +1 -1
  10. package/dist/VideoPlayer-8b06fc9a.js +2415 -0
  11. package/dist/VideoPlayer-8b06fc9a.js.map +1 -0
  12. package/dist/VideoPlayer-9f881121.cjs +3 -0
  13. package/dist/VideoPlayer-9f881121.cjs.map +1 -0
  14. package/dist/{index-c5e6e20b.js → index-425a27ee.js} +3408 -3296
  15. package/dist/index-425a27ee.js.map +1 -0
  16. package/dist/index-f24568c0.cjs +105 -0
  17. package/dist/index-f24568c0.cjs.map +1 -0
  18. package/dist/leaflet-src.esm-28c838de.cjs.map +1 -1
  19. package/dist/{leaflet-src.esm-114b2dcb.js → leaflet-src.esm-337e0d64.js} +25 -8
  20. package/dist/{leaflet-src.esm-114b2dcb.js.map → leaflet-src.esm-337e0d64.js.map} +1 -1
  21. package/dist/marker-icon-2x-b9d2094a.js.map +1 -1
  22. package/dist/marker-icon-2x-c96d03d7.cjs.map +1 -1
  23. package/dist/marker-icon-b2ca459f.js.map +1 -1
  24. package/dist/marker-icon-ea2516b7.cjs.map +1 -1
  25. package/dist/marker-shadow-8f64c412.cjs.map +1 -1
  26. package/dist/marker-shadow-eea80fe0.js.map +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/tg-blog.cjs.js +1 -1
  29. package/dist/tg-blog.es.js +1 -1
  30. package/dist/tg-blog.umd.js +75 -74
  31. package/dist/tg-blog.umd.js.map +1 -1
  32. package/dist/types/views/ImageViewer.vue.d.ts +1 -1
  33. package/dist/types/views/TgBlog.vue.d.ts +3 -0
  34. package/dist/types/views/VideoPlayer.vue.d.ts +17 -0
  35. package/package.json +6 -5
  36. package/src/App.vue +1 -0
  37. package/src/auto-imports.d.ts +9 -2
  38. package/src/components.d.ts +5 -2
  39. package/src/css/colors.sass +1 -0
  40. package/src/css/global.sass +5 -2
  41. package/src/views/FileView.vue +15 -8
  42. package/src/views/ImageViewer.vue +96 -90
  43. package/src/views/PostView.vue +1 -1
  44. package/src/views/TgBlog.vue +87 -2
  45. package/src/views/VideoPlayer.vue +25 -0
  46. package/dist/Location-cbb3b437.cjs.map +0 -1
  47. package/dist/index-c5e6e20b.js.map +0 -1
  48. package/dist/index-fd56cf1f.cjs +0 -105
  49. package/dist/index-fd56cf1f.cjs.map +0 -1
package/README.md CHANGED
@@ -61,6 +61,62 @@ You can use it in plain HTML without a modern web build tool:
61
61
  </html>
62
62
  ```
63
63
 
64
+ ### Use in Hexo Blog
65
+
66
+ You can also use it in a Hexo blog like in [Linda's Blog](https://blog.1mether.me/tg-channel) ([source code](https://github.com/locoda/blog/blob/master/source/tg-channel.md?plain=1))
67
+
68
+ Depending on the css of your theme, it might need some modifications to work. For example, [these modifications](https://github.com/locoda/blog/pull/66) were needed for the Icalm theme.
69
+
70
+ However, you can add the page as a markdown in the following format:
71
+
72
+ ```md
73
+ ---
74
+ title: 'Telegram Blog'
75
+ date: 2023-01-13
76
+ ---
77
+
78
+ {% raw %}
79
+
80
+ <!-- Import Libraries -->
81
+ <script src="https://unpkg.com/vue@3"></script>
82
+ <script src="https://unpkg.com/tg-blog"></script>
83
+ <link rel="stylesheet" href="https://unpkg.com/tg-blog/dist/style.css">
84
+
85
+ <!-- Styles & Patches -->
86
+ <style>
87
+ #tg-blog-app { font-family: Avenir, Helvetica, Arial, sans-serif }
88
+
89
+ /* Icalm Fix: Override img max-width: 100% set in layout.styl */
90
+ #tg-blog-app img { max-width: unset; }
91
+
92
+ /* Icalm Fix: overflow-x: hidden breaks infinite scroll */
93
+ .container { overflow-x: unset !important; }
94
+ body { overflow-x: unset !important; }
95
+ </style>
96
+
97
+ <!-- Template setup (Paste your data url here) -->
98
+ <div id="tg-blog-app">
99
+ <tg-blog posts-url="YOUR-POSTS-URL-HERE!"></tg-blog>
100
+ </div>
101
+
102
+ <!-- Vue js setup -->
103
+ <script>
104
+ const app = Vue.createApp().component("tg-blog", TgBlog.TgBlog)
105
+ app.mount('#tg-blog-app')
106
+
107
+ // Hexo patch: Destroy app when page switched
108
+ const interval = setInterval(() => {
109
+ if (!document.getElementById('tg-blog-app'))
110
+ {
111
+ app.unmount()
112
+ clearInterval(interval)
113
+ }
114
+ }, 1000)
115
+ </script>
116
+
117
+ {% endraw %}
118
+ ```
119
+
64
120
  ### Use in Vite
65
121
 
66
122
  You can also use import it into your project using modern build tools like vite: