Skip to content

Commit

Permalink
add: waline emoji url
Browse files Browse the repository at this point in the history
  • Loading branch information
YiHui-Liu committed Jul 23, 2022
1 parent 36610e0 commit 34a40cb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
20 changes: 12 additions & 8 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ waline:
admin:
# Comment box placeholder.
placeholder: Just go go
# emoji
emoji:
- https://cdn.jsdelivr.net/gh/walinejs/[email protected]/bilibili
- https://cdn.jsdelivr.net/gh/walinejs/[email protected]/qq

# Valine
# See: https://valine.js.org/quickstart.html
Expand Down Expand Up @@ -753,12 +757,12 @@ math:
enable: false
mhchem_js: https://cdn.jsdelivr.net/npm/[email protected]/mhchem.min.js
katex:
cdn: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css
cdn: https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.css
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
copy_tex:
enable: true
copy_tex_js: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.min.js
copy_tex_css: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.css
copy_tex_js: https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/contrib/copy-tex.min.js
copy_tex_css: https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/contrib/copy-tex.css

# ---------------------------------------------------------------
# Other config
Expand Down Expand Up @@ -934,19 +938,19 @@ icon:
# ! Do not edit the follow configs, unless you know what you are doing.
# ! -------------------------------------------------------------------
cdn:
# Using version: 5.12.1
# Using version: 5.15.3
# See: https://fontawesome.com/
# Example:
# fontawesome: //cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css
# fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css
fontawesome:

# Using version: 3.4.1
# Using version: 3.6.0
# Example:
# jquery: //cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js
# jquery: //cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
# jquery: //cdn.jsdelivr.net/npm/jquery@v3.6.0/dist/jquery.min.js
# jquery: //cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
jquery:

# Using version: 1.5.2
Expand Down
2 changes: 1 addition & 1 deletion layout/_third-party/comments/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if page.comments || theme.pjax.enable
include ./livere.pug
else if theme.fbcomments.enable
include ./fbcomments.pug
else if theme.waline.enable && theme.waline.visitor
else if theme.waline.enable && theme.waline.pageview
include ./waline.pug
else if theme.valine.enable && theme.valine.visitor
include ./valine.pug
4 changes: 4 additions & 0 deletions layout/_third-party/comments/waline.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ script&attributes(dataPjax).
var META = ['nick', 'mail', 'link'];
var need_meta = '!{ theme.waline.meta }';
var require_meta = '!{theme.waline.requiredMeta}';
var emojiURL = '!{theme.waline.emoji}';

need_meta = need_meta.split(',').filter(function(item) {
return META.indexOf(item) > -1;
Expand All @@ -27,10 +28,13 @@ script&attributes(dataPjax).
return META.indexOf(item) > -1;
});

emojiURL = emojiURL.split(',');

Waline.init({
el: location.pathname === '/' ? null : '#waline-container',
serverURL: '!{theme.waline.serverURL}',
pageview: location.hostname!=='localhost' && !{theme.waline.pageview} ,
emoji: emojiURL,
wordLimit: !{theme.waline.wordLimit},
path: location.pathname,
meta: need_meta,
Expand Down
1 change: 1 addition & 0 deletions source/css/_variables/layout.styl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $sm-width = 768px - 0.02px
$md-width = 992px - 0.02px
$lg-width = 1200px - 0.02px

$gap = 16px
$gap-p = 1em
get-main-padding() {
$main-padding = convert(hexo-config('layout.main_padding.default'));
Expand Down

0 comments on commit 34a40cb

Please sign in to comment.