This is a continuation of my previous post… previous_post…
I use schnack commenting sytem: SCHNACK
I successfully made a slack
webhook.
In files:
slack.js:
const post_url = config.get('page_url').replace('%SLUG%', event.slug)+'#comment-'+event.id;
page_url:
"page_url": "https://example.com/%SLUG%",
In blogpost:
<h1 id="try-schnack">
<a class="anchor" href="#try-schnack">
Try schnack</a>
</h1>
<div class="comments-go-here"></div>
<% var title = post.title %>
<% var slug = post.slug %>
<% var sluglink = [title,slug].join('+++++') %>
<script type="text/javascript"
src="https://schnack.example.com/embed.js"
data-schnack-slug="<%= sluglink %>"
data-schnack-target=".comments-go-here">
</script>
This all works. But I need output following: title/slug
and NOT title+++++slug
If I do .join('/')
then SCHNACK commenting system
does not work at all anymore, it crashes. Strangely enough I can put any character in .join('XXXXXXXX')
here but EXCEPT /
and let that be the one I need.
I need the slash /
as separator between title and slug, so my result is this: title/slug
.
How to make that work?