diff --git a/docker-init.sh b/docker-init.sh index 3347fee546..1c96a58627 100755 --- a/docker-init.sh +++ b/docker-init.sh @@ -1,7 +1,12 @@ #!/bin/sh echo "prepare environment" # replace BASE_URL constant by REMARK_URL -sed -i "s|https://demo.remark42.com|${REMARK_URL}|g" /srv/web/*.js +sed -i "s|https://demo.remark42.com|${REMARK_URL}|g" /srv/web/*.{js,html} + +if [ -n "${SITE_ID}" ]; then + #replace "site_id: 'remark'" by SITE_ID + se -i "s|'remark'|'${SITE_ID}'|g" /srv/web/*.html +fi if [ -d "/srv/var" ]; then chown -R app:app /srv/var 2>/dev/null diff --git a/frontend/comments.ejs b/frontend/comments.ejs index caba10fcb3..50af6a979a 100644 --- a/frontend/comments.ejs +++ b/frontend/comments.ejs @@ -68,7 +68,7 @@ var remark_config = { site_id: query.site_id, - host: window.location.origin, + host: '<%= htmlWebpackPlugin.options.remarkUrl %>', url: query.url }; diff --git a/frontend/counter.ejs b/frontend/counter.ejs index b0f6392008..70234b839a 100644 --- a/frontend/counter.ejs +++ b/frontend/counter.ejs @@ -39,7 +39,7 @@