Support comments using mastodon #30
Loading…
Reference in New Issue
No description provided.
Delete Branch "mastodon"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If you put a file called
metadata.json
into an entry folder, and it looks like this:Then the tree of replies to that toot will be used as the comments for the journal entry. This PR only supports HTML, but it does support HTML comments both inline (with javascript) and in a separate page (without javascript).
So far it has been tested in modern browsers, and lynx. The client-side javascript is written such that it should work on older browsers but this has not been tested.
@ -0,0 +14,4 @@
const args = { ...defaults, ...query }
const commentsHtml = execSync(`node /home/mycrobe/cms/src/mastodonComments.js --fragment ${args.fragment} --rootToot ${args.rootToot} --tootSource ${args.tootSource} --title "${args.title}" --backlink "${args.backlink}"`).toString()
the cgi script operates without the benefit of node_modules, so the easiest thing to do is just invoke the script from a shell. I'm sure this is very efficient.
@ -0,0 +1,19 @@
#!/usr/bin/env node
cgi script that takes arguments from a query string, and calls the
mastodonComment.js
script to get the html for the comment thread@ -0,0 +1,29 @@
window.MYCROBE = {
client-side javascript code that calls the CGI script
@ -39,4 +55,2 @@
${content}
</div>
<pre class="metadata-raw">
${JSON.stringify(data, null, ' ')}
note i removed the hidden dump of raw metadata
@ -0,0 +1,77 @@
const args = require('minimist')(process.argv.slice(2), {string: 'rootToot', boolean: 'fragment'})
no html-specific logic here. need to make gemini templates still