diff --git a/frontend/apps/remark42/templates/counter.ejs b/frontend/apps/remark42/templates/counter.ejs index b0999d47..b3c8f829 100644 --- a/frontend/apps/remark42/templates/counter.ejs +++ b/frontend/apps/remark42/templates/counter.ejs @@ -21,13 +21,13 @@

First counter with url from data-attribute: - (note) + (note)

Second counter with url from global remark config: - (note) + (note)

If it can't get url from data-attribute or remark config, it will try to use window.location.href for it.

@@ -36,7 +36,7 @@ diff --git a/frontend/apps/remark42/templates/demo.ejs b/frontend/apps/remark42/templates/demo.ejs index 2c04a4ad..59dc468f 100644 --- a/frontend/apps/remark42/templates/demo.ejs +++ b/frontend/apps/remark42/templates/demo.ejs @@ -72,11 +72,11 @@

- Last comments widget page
- + Last comments widget page
+
- Counter widget page
+ Counter widget page
Comments count:
@@ -121,9 +121,15 @@ window.REMARK42.changeTheme('dark'); }); + var remarkBase = location.origin + location.pathname.replace(/\/[^/]*$/, '').replace(/\/web$/, ''); + + document.querySelector('.widget__link_page_last-comments').href = remarkBase + '/web/last-comments.html'; + document.querySelector('.widget__comments-frame').src = remarkBase + '/web/last-comments.html'; + document.querySelector('.widget__link_page_counter').href = remarkBase + '/web/counter.html'; + var remark_config = { site_id: 'remark', - host: '<%= htmlWebpackPlugin.options.REMARK_URL %>', + host: remarkBase, url: window.location.href, components: ['embed', 'counter'], // __colors__: { diff --git a/frontend/apps/remark42/templates/last-comments.ejs b/frontend/apps/remark42/templates/last-comments.ejs index 77240412..3bb1654d 100644 --- a/frontend/apps/remark42/templates/last-comments.ejs +++ b/frontend/apps/remark42/templates/last-comments.ejs @@ -26,7 +26,7 @@