Skip to content

Commit

Permalink
Merge pull request #66 from hykilpikonna/master
Browse files Browse the repository at this point in the history
[F] Fix blog embedding
  • Loading branch information
locoda authored Jan 14, 2023
2 parents 7d9fe6f + 296f68e commit 3da77c9
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion source/tg-channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,41 @@ date: 2023-01-13

{% raw %}

<iframe src="https://tg.1mether.me/" frameborder="0" scrolling="yes" seamless="seamless" style="display:block; width:100%; height:90vh;"></iframe>
<!-- Import Libraries -->
<script src="https://unpkg.com/vue@3"></script>
<script src="https://unpkg.com/tg-blog"></script>
<link rel="stylesheet" href="https://unpkg.com/tg-blog/dist/style.css">

<!-- Styles & Patches -->
<style>
#tg-blog-app { font-family: Avenir, Helvetica, Arial, sans-serif }

/* Fix: Override img max-width: 100% set in layout.styl */
#tg-blog-app img { max-width: unset; }

/* Fix: overflow-x: hidden breaks infinite scroll */
.container { overflow-x: unset !important; }
body { overflow-x: unset !important; }
</style>

<!-- Template setup (Paste your data url here) -->
<div id="tg-blog-app">
<tg-blog posts-url="https://tg.1mether.me/posts.json"></tg-blog>
</div>

<!-- Vue js setup -->
<script>
const app = Vue.createApp().component("tg-blog", TgBlog.TgBlog)
app.mount('#tg-blog-app')

// Destroy app when page switched
const interval = setInterval(() => {
if (!document.getElementById('tg-blog-app'))
{
app.unmount()
clearInterval(interval)
}
}, 1000)
</script>

{% endraw %}

0 comments on commit 3da77c9

Please sign in to comment.