tg-blog 1.0.11 → 1.1.0
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.
- package/README.md +56 -0
- package/dist/{Location-d7867b06.js → Location-038d6bfe.js} +1576 -1544
- package/dist/Location-038d6bfe.js.map +1 -0
- package/dist/{Location-cbb3b437.cjs → Location-26030a74.cjs} +3 -3
- package/dist/{Location-d7867b06.js.map → Location-26030a74.cjs.map} +1 -1
- package/dist/{Poll-16a454bd.cjs → Poll-37190a20.cjs} +2 -2
- package/dist/{Poll-16a454bd.cjs.map → Poll-37190a20.cjs.map} +1 -1
- package/dist/{Poll-e903e06f.js → Poll-7f9be6c7.js} +2 -2
- package/dist/{Poll-e903e06f.js.map → Poll-7f9be6c7.js.map} +1 -1
- package/dist/VideoPlayer-8b06fc9a.js +2415 -0
- package/dist/VideoPlayer-8b06fc9a.js.map +1 -0
- package/dist/VideoPlayer-9f881121.cjs +3 -0
- package/dist/VideoPlayer-9f881121.cjs.map +1 -0
- package/dist/{index-c5e6e20b.js → index-425a27ee.js} +3408 -3296
- package/dist/index-425a27ee.js.map +1 -0
- package/dist/index-f24568c0.cjs +105 -0
- package/dist/index-f24568c0.cjs.map +1 -0
- package/dist/leaflet-src.esm-28c838de.cjs.map +1 -1
- package/dist/{leaflet-src.esm-114b2dcb.js → leaflet-src.esm-337e0d64.js} +25 -8
- package/dist/{leaflet-src.esm-114b2dcb.js.map → leaflet-src.esm-337e0d64.js.map} +1 -1
- package/dist/marker-icon-2x-b9d2094a.js.map +1 -1
- package/dist/marker-icon-2x-c96d03d7.cjs.map +1 -1
- package/dist/marker-icon-b2ca459f.js.map +1 -1
- package/dist/marker-icon-ea2516b7.cjs.map +1 -1
- package/dist/marker-shadow-8f64c412.cjs.map +1 -1
- package/dist/marker-shadow-eea80fe0.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tg-blog.cjs.js +1 -1
- package/dist/tg-blog.es.js +1 -1
- package/dist/tg-blog.umd.js +75 -74
- package/dist/tg-blog.umd.js.map +1 -1
- package/dist/types/views/ImageViewer.vue.d.ts +1 -1
- package/dist/types/views/TgBlog.vue.d.ts +3 -0
- package/dist/types/views/VideoPlayer.vue.d.ts +17 -0
- package/package.json +6 -5
- package/src/App.vue +1 -0
- package/src/auto-imports.d.ts +9 -2
- package/src/components.d.ts +5 -2
- package/src/css/colors.sass +1 -0
- package/src/css/global.sass +5 -2
- package/src/views/FileView.vue +15 -8
- package/src/views/ImageViewer.vue +96 -90
- package/src/views/PostView.vue +1 -1
- package/src/views/TgBlog.vue +84 -2
- package/src/views/VideoPlayer.vue +25 -0
- package/dist/Location-cbb3b437.cjs.map +0 -1
- package/dist/index-c5e6e20b.js.map +0 -1
- package/dist/index-fd56cf1f.cjs +0 -105
- 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:
|