diff --git a/layout/includes/header/post-info.pug b/layout/includes/header/post-info.pug index 3293697..6993123 100644 --- a/layout/includes/header/post-info.pug +++ b/layout/includes/header/post-info.pug @@ -116,4 +116,8 @@ when 'Facebook Comments' +countBlock a(href=url_for(page.path) + '#post-comment') - span.fb-comments-count(data-href=urlNoIndex()) \ No newline at end of file + span.fb-comments-count(data-href=urlNoIndex()) + when 'Remark42' + +countBlock + a(href=url_for(page.path) + '#post-comment') + span(class="remark42__counter" data-url=urlNoIndex()) \ No newline at end of file diff --git a/layout/includes/mixins/post-ui.pug b/layout/includes/mixins/post-ui.pug index d2cb014..d3bf406 100644 --- a/layout/includes/mixins/post-ui.pug +++ b/layout/includes/mixins/post-ui.pug @@ -88,6 +88,10 @@ mixin postUI(posts) +countBlockInIndex a(href=url_for(link) + '#post-comment') span.fb-comments-count(data-href=urlNoIndex(article.permalink)) + when 'Remark42' + +countBlockInIndex + a(href=url_for(link) + '#post-comment') + span(class="remark42__counter" data-url=urlNoIndex(article.permalink)) //- Display the article introduction on homepage case theme.index_post_content.method diff --git a/layout/includes/third-party/card-post-count/index.pug b/layout/includes/third-party/card-post-count/index.pug index 44839b3..195d9ec 100644 --- a/layout/includes/third-party/card-post-count/index.pug +++ b/layout/includes/third-party/card-post-count/index.pug @@ -9,4 +9,6 @@ case theme.comments.use[0] when 'Waline' include ./waline.pug when 'Facebook Comments' - include ./fb.pug \ No newline at end of file + include ./fb.pug + when 'Remark42' + include ./remark42.pug \ No newline at end of file diff --git a/layout/includes/third-party/card-post-count/remark42.pug b/layout/includes/third-party/card-post-count/remark42.pug new file mode 100644 index 0000000..7de001b --- /dev/null +++ b/layout/includes/third-party/card-post-count/remark42.pug @@ -0,0 +1,21 @@ +- const { host, siteId, language, option } = theme.remark42 + +script. + let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light' + var remark_config = Object.assign({ + host: '!{host}', + site_id: '!{siteId}', + components: ['counter'] + },!{JSON.stringify(option)}) + +script. + function loadRemark42(){ + !function(e,r){ + for(var o=r.head||r.body,n=0;n