Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[F] Fix blog embedding #66

Merged
merged 1 commit into from
Jan 14, 2023
Merged

[F] Fix blog embedding #66

merged 1 commit into from
Jan 14, 2023

Conversation

hykilpikonna
Copy link
Contributor

I looked into why the embedding didn't work on your blog. Here were the issues and how I fixed them:

  1. You shouldn't have <html> and <body> inside a generated html that has <html> and <body> already, so I just moved the important code outside the <html> container

  2. The images aren't displaying. This is because of line 48 of layout.styl that set a max-width: 100% limit for all images. So I added the following css in tg-channel.md to unset max width in the scope of this page:

#tg-blog-app img { max-width: unset; }
  1. On mobile view, infinite scroll didn't work and it tried to load everything at once. This is definitely a bug in the ElementPlus library I used but I noticed that it works normally if we unset the overflow-x: hidden flag:
.container { overflow-x: unset !important; }
body { overflow-x: unset !important; }
  1. When switching to a new page, the mounted element is removed but the app's javascript still runs in the background. The proper way to fix this probably needs tweaking some hexo structure, so I just fixed it using a quick timeout:
const interval = setInterval(() => {
    if (!document.getElementById('tg-blog-app')) 
    {
        app.unmount()
        clearInterval(interval)
    }
}, 1000)

Now everything should work!

hykilpikonna added a commit to one-among-us/tg-blog that referenced this pull request Jan 14, 2023
@locoda locoda merged commit 3da77c9 into locoda:master Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants