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

Staticman-v2 doesn't show up in the topic if the topic is Chinese character #1438

Closed
2 tasks
yuanqingfei opened this issue Jan 2, 2018 · 12 comments
Closed
2 tasks

Comments

@yuanqingfei
Copy link

  • This is a question about using the theme.
  • [X ] This is a feature request.
  • [X ] I believe this to be a bug with the theme.
    • [X ] I have updated all gems with bundle update.
    • I have tested locally with bundle exec jekyll build.

Environment informations

  • Minimal Mistakes version: latest
  • Jekyll version: latest
  • GitHub Pages hosted: yes
  • Operating system: Ubuntu

Expected behavior

I have tested the comments with staticman v2 on one of my post with english as title. it works like here:
https://yuanqingfei.me/Hello-World/. However, if the URL contains Chinese character, I can see the comments have been inserted into my repository correctly. But these comments just cannot show up in the UI for any other Chinese title post.

Steps to reproduce the behavior

just need try post for any Chinese title post. it will not show up but it do show up for my first post.

@mmistakes
Copy link
Owner

Please provide a link to a public repo with the issue.

The way the comments are brought in is when a comment is approved Staticman creates data files under _data/comments in a folder that matches the post's slug. I'll need to verify what it's creating and what your post slug is. If they don't match... no comments on the page.

For example your Hello World post work's because the comment data file folder is /_data/comments/Hello-World and the post's slug is Hello-World.

@yuanqingfei
Copy link
Author

Thanks for quick response. I have seen your test in my repository.

https://github.com/yuanqingfei/yuanqingfei.github.io/blob/master/_data/comments/%E7%A7%BB%E6%B0%91%E5%8A%A0%E6%8B%BF%E5%A4%A7-1/entry1514909217040.yml

_id: f4c1a260-efd6-11e7-847a-f738a8b9adad
message: Test
name: Tester
email: b642b4217b34b1e8d3bd915fc65c4452
url: ''
hidden: ''
date: 1514909217

@yuanqingfei
Copy link
Author

but I cannot see your comments in my website. https://yuanqingfei.me/immigration/%E7%A7%BB%E6%B0%91%E5%8A%A0%E6%8B%BF%E5%A4%A7-1

@mmistakes
Copy link
Owner

mmistakes commented Jan 2, 2018

The the post slug might need to be escaped in the Staticman form code as the url looks to be that way. That's why the comment isn't showing up, one has the Chinese characters, the other is using the escaped HTML.

I'll have to do some testing.

@mmistakes
Copy link
Owner

There might be something else at play. I tried cloning your repo and building it locally and all the Chinese title posts don't work. The characters are messed up and clicking any of the links go to 404 pages.

image

The only link that works is the English title... "Hello World". There may be a Jekyll setting for this but I'm unfamiliar with it as I only ever write content in English.

@yuanqingfei
Copy link
Author

The reason is that your computer(Windows or Linux) have not install Chinese Language Pack....

In my opinion, this should be caused by comments cannot be mapped by 'Unicoded Character'. That is to say, it doesn't support UTF-8 for this level.

@yuanqingfei
Copy link
Author

screenshot from 2018-01-02 21-34-05

it looks like this in my local machine.

@mmistakes
Copy link
Owner

mmistakes commented Jan 3, 2018

That makes sense. In that case not sure if I’m going to be much help at solving this issue.

Hard to tell what’s at fault here:

@yuanqingfei
Copy link
Author

In fact, there are also 2 other places doesn't support Unicode, one is the search function which only search english. the other is read time calculation. Of course, all these are not necessarily caused by your theme, maybe just caused by 3-rd plugin or Jekyll. Anyway, Thanks a lot for your great work for such a great theme! thanks again!.

@WizKidd42
Copy link

Bug

@stale
Copy link

stale bot commented Dec 27, 2018

This issue has been automatically marked as stale because it has not had recent activity.

If this is a bug and you can still reproduce this error on the master branch, please reply with any additional information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Status: Stale label Dec 27, 2018
@stale stale bot closed this as completed Jan 15, 2019
@VincentTam
Copy link
Contributor

VincentTam commented Jul 1, 2019

@yuanqingfei Here's a blog article that proposed a modification of the template code to solve this problem. You're right that that's a problem with Jekyll's slug. The author of the article suggests using site.data.comments[page.uuid] instead to solve this problem.

Reference: 使用Statiman给博客提供评论功能(二)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants