diff --git a/package.json b/package.json index 41cd116..24131b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-microsub", - "version": "1.0.17", + "version": "1.0.18", "description": "Microsub endpoint for Indiekit. Enables subscribing to feeds and reading content using the Microsub protocol.", "keywords": [ "indiekit", diff --git a/views/channel.njk b/views/channel.njk index 8274fbf..01a5a42 100644 --- a/views/channel.njk +++ b/views/channel.njk @@ -119,6 +119,9 @@ // Handle individual mark-read buttons const channelUid = timeline.dataset.channel; + // Microsub API is at the parent of /reader (e.g., /microsub not /microsub/reader) + const microsubApiUrl = '{{ baseUrl }}'.replace(/\/reader$/, ''); + timeline.addEventListener('click', async (e) => { const button = e.target.closest('.item-actions__mark-read'); if (!button) return; @@ -139,7 +142,7 @@ formData.append('channel', channelUid); formData.append('entry', itemId); - const response = await fetch('{{ baseUrl }}', { + const response = await fetch(microsubApiUrl, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded',