Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

support twikoo comment system #239

Merged
merged 32 commits into from
Jul 22, 2021
Merged

support twikoo comment system #239

merged 32 commits into from
Jul 22, 2021

Conversation

OnlyFor
Copy link
Contributor

@OnlyFor OnlyFor commented Jul 14, 2021

No description provided.

victor-pogor and others added 28 commits May 2, 2021 22:23
…yasin

docs: add aiyasin as a contributor
RE #173

Use the selector already included with PR #173
fix(gist): fixed the lost of indentation
…latanado

docs: add aplatanado as a contributor for code
…w717

docs: add ktw717 as a contributor for code, doc
Copy link
Member

@victor-pogor victor-pogor left a comment

Choose a reason for hiding this comment

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

Hi @OnlyFor.

Thank you very much for your contributions. I left some comments on this PR.

Also, other things we will need to update:

  • Update the README.md file and add the required information in the features of these new comment systems.
  • Update the Theme Documentation basics article, on the configuration section, about these newly added comment systems.

[params.page.comment.waline]
enable = false
#js = "https://cdn.jsdelivr.net/npm/@waline/client@latest"
js = "https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js"
Copy link
Member

Choose a reason for hiding this comment

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

Can you move please this parameter in the assets/data/cdn/jsdelivr.yml file?

We have a single place for the CDN files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

dark = 'auto'
[params.page.comment.twikoo]
enable = false
js = "https://cdn.jsdelivr.net/npm/[email protected]/dist/twikoo.all.min.js"
Copy link
Member

Choose a reason for hiding this comment

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

I think the properties should be indented at the same level, they're all referenced to the params.page.comment.twikoo group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

{{- $twikoo := $comment.twikoo | default dict -}}
{{- if $twikoo.enable -}}
<div id="twikoo"></div>
<script src="{{ $twikoo.js }}"></script>
Copy link
Member

Choose a reason for hiding this comment

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

Can you use something like this?

{{- /* Gitalk Comment System */ -}}
{{- $gitalk := $comment.gitalk | default dict -}}
{{- if $gitalk.enable -}}
<div id="gitalk" class="comment"></div>
{{- $source := $cdn.gitalkCSS | default "lib/gitalk/gitalk.css" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.gitalkJS | default "lib/gitalk/gitalk.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $commentConfig = dict "id" .Date "title" .Title "clientID" $gitalk.clientId "clientSecret" $gitalk.clientSecret "repo" $gitalk.repo "owner" $gitalk.owner "admin" (slice $gitalk.owner) | dict "gitalk" | merge $commentConfig -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://github.com/gitalk/gitalk"></a>Gitalk</a>.
</noscript>
{{- end -}}

We have the script partial page for this, and we can use also the file from the jsdelivr.yml file. Also, as a default value, it would be nice to have a local copy of the twikoo/waline scripts files. They are stored in this location: assets/lib.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried...but I only learned javascript for a few weeks...I hope you can help adjust if necessary

<span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<i class="far fa-eye fa-fw"></i>&nbsp;<span class=leancloud-visitors-count></span>&nbsp;{{ T "views" }}
</span>&nbsp;
<a href="#comments" id="post-meta-vcount" title="{{ T `viewComments` }}">
Copy link
Member

Choose a reason for hiding this comment

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

The indentation should be the same as is on the 65th line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

May be done ?

@@ -24,3 +24,5 @@ [email protected] https://github.com/metowolf/MetingJS
[email protected] https://github.com/gitalk/gitalk
[email protected] https://valine.js.org/
[email protected] https://github.com/osano/cookieconsent
[email protected] https://github.com/imaegoo/twikoo
Copy link
Member

@victor-pogor victor-pogor Jul 19, 2021

Choose a reason for hiding this comment

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

@OnlyFor did you use some packaging tool or did you manually update this file? I'm asking this because I don't know how this file was generated ))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I……manually update this file……

Copy link
Member

Choose a reason for hiding this comment

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

No worries. I just asked. I thought maybe there is some package manager tool.

@@ -563,6 +563,17 @@ Please open the code block below to view the complete sample configuration :(far
label = ""
lightTheme = "github-light"
darkTheme = "github-dark"
# {{< link "https://waline.js.org/en/" "Waline" >}} comment config
Copy link
Member

@victor-pogor victor-pogor Jul 19, 2021

Choose a reason for hiding this comment

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

Can you also add this shortcode: {{< version 0.2.0 >}}

The result will look something like this:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@victor-pogor victor-pogor left a comment

Choose a reason for hiding this comment

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

Good job. Thank you !!!

@@ -24,3 +24,5 @@ [email protected] https://github.com/metowolf/MetingJS
[email protected] https://github.com/gitalk/gitalk
[email protected] https://valine.js.org/
[email protected] https://github.com/osano/cookieconsent
[email protected] https://github.com/imaegoo/twikoo
Copy link
Member

Choose a reason for hiding this comment

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

No worries. I just asked. I thought maybe there is some package manager tool.

@victor-pogor
Copy link
Member

@all-contributors please add @OnlyFor for code, docs

@allcontributors
Copy link
Contributor

@victor-pogor

I've put up a pull request to add @OnlyFor! 🎉

@victor-pogor victor-pogor changed the base branch from master to dev July 22, 2021 18:09
@victor-pogor victor-pogor merged commit a4a4d7b into sunt-programator:dev Jul 22, 2021
@victor-pogor victor-pogor linked an issue Jul 22, 2021 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] 增加 waline 评论系统
3 participants