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

Validation Failed(422) found in gitalk #507

Closed
duval1024 opened this issue Sep 5, 2021 · 1 comment
Closed

Validation Failed(422) found in gitalk #507

duval1024 opened this issue Sep 5, 2021 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@duval1024
Copy link
Contributor

duval1024 commented Sep 5, 2021

Here comes the second issues. Please let me fix it if needed this time.

Actual behavior

I use gitalk in Chinese language. And the URI encoding makes the parameter named id pretty long(more than 50 chars)which results in Validation Failed (422)

new Gitalk({
          clientID: '{{ .Site.Params.comment.gitalk.clientId }}',
          clientSecret: '{{ .Site.Params.comment.gitalk.clientSecret }}',
          repo: '{{ .Site.Params.comment.gitalk.repo }}',
          owner: '{{ .Site.Params.comment.gitalk.owner }}',
          admin: ['{{ .Site.Params.comment.gitalk.owner }}'],
          id: '{{ .RelPermalink }}',  // Ensure uniqueness and length less than 50
          ...{{ .Site.Params.comment.gitalk.options | jsonify | safeJS }}
        }).render('gitalk')

How to fix

wrapper {{ .RelPermalink }} by decodeURI function.

e.g.
image

image

@kakawait kakawait added the bug Something isn't working label Sep 5, 2021
@kakawait kakawait added this to the 0.5.2-BETA milestone Sep 5, 2021
@kakawait
Copy link
Owner

kakawait commented Sep 5, 2021

I've assigned you the issue. I'll let you create a Pull Request

duval1024 added a commit to duval1024/hugo-tranquilpeak-theme that referenced this issue Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants