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

fix(comments/cusdis): use the correct script for the self-hosted version #403

Merged
merged 3 commits into from
Oct 31, 2021

Conversation

hu3rror
Copy link
Contributor

@hu3rror hu3rror commented Oct 28, 2021

refer: https://cusdis.com/doc#/advanced/sdk

If you are using self-hosted Cusdis, remember changing the data-host and the host in <script> to your own domain

Copy link
Owner

@CaiJimmy CaiJimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can refactor the code this way to avoid multiple if sentence.

{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
<div id="cusdis_thread"
    data-host="{{ $host }}"
    data-app-id="{{ .Site.Params.comments.cusdis.id }}"
    data-page-id="{{ .File.UniqueID }}"
    data-page-url="{{ .Permalink }}"
    data-page-title="{{ .Title }}"></div>
<script async defer src="{{ $host }}/js/cusdis.es.js"></script>

@hu3rror
Copy link
Contributor Author

hu3rror commented Oct 31, 2021

Thank you for your code :)

@CaiJimmy CaiJimmy changed the title Modify the Self-hosting js source path fix(comments/cusdis): use the correct script for the self hosted version Oct 31, 2021
@CaiJimmy CaiJimmy changed the title fix(comments/cusdis): use the correct script for the self hosted version fix(comments/cusdis): use the correct script for the self-hosted version Oct 31, 2021
@CaiJimmy CaiJimmy added the fix label Oct 31, 2021
@CaiJimmy CaiJimmy merged commit 25581cc into CaiJimmy:master Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants