Skip to content

Commit f45709c

Browse files
add link to Zulip at bottom of post
1 parent d6cc31e commit f45709c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

site/_quarto.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ format:
4949
dark: [ darkly, brand, styles.scss, styles-dark.scss ]
5050
respect-user-color-scheme: true
5151
lightbox: true
52+
include-after-body: zulip_script.html
5253
include-in-header:
5354
- text: |
5455
<script data-goatcounter="https://clojurecivitas.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>

site/zulip_script.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script>
2+
document.addEventListener('DOMContentLoaded', (event) => {
3+
const zulipOrg = "clojurians.zulipchat.com";
4+
const zulipChannel = "clojurecivitas";
5+
const slug = window.location.pathname.split('/').pop().replace(/\.html$/, '');
6+
7+
if (slug) {
8+
const zulipURL = `https://${zulipOrg}/#narrow/stream/${zulipChannel}/topic/${slug}`;
9+
const linkHTML = `<p><a href="${zulipURL}">Discuss ${slug} on Zulip</a></p>`;
10+
document.getElementById('quarto-content').insertAdjacentHTML('beforeend', linkHTML);
11+
}
12+
});
13+
</script>
14+

0 commit comments

Comments
 (0)