hugo-mastodon-api-comments/README.adoc

41 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-10-31 05:34:19 +01:00
= mastodon-api-comments
2019-10-31 05:45:53 +01:00
:uri-mastodon-js: https://github.com/Kirschn/mastodon.js
:uri-jquery: https://jquery.com/download/
2019-10-31 05:34:19 +01:00
== Setup
First copy `mastodon-api-comments.html` to your shortcodes directory. This is
either `layouts/shortcodes` or `themes/{your-theme}/layouts/shortcodes`.
2019-10-31 05:45:53 +01:00
Then download link:{uri-mastodon-js}[mastodon.js] and link:{uri-jquery}[JQuery]
2019-10-31 05:34:19 +01:00
and copy it together with `mastodon-api-comments.js` from this repo into
`content/scripts`.
Then add the following code to
`layouts/partials/mastodon-api-comments-scripts.html` or
`themes/{your-theme}/layouts/partials/mastodon-api-comments-scripts.html`:
[source,HTML]
----
<script type="application/javascript" src="/scripts/jquery-3.4.1.min.js"></script>
<script type="application/javascript" src="/scripts/mastodon.js"></script>
<script type="application/javascript" src="/scripts/mastodon-api-comments.js"></script>
----
== Usage
The shortcode takes the following arguments:
[options="header"]
|=============================================
| Argument | Description
| instance | The domain name of the instance.
| status_id | The ID of the status.
|=============================================
// === Example
// ----
// {{% mastodon-api-comments instance="likeable.space" status_id="9nIqtmAXvu4harUb7Q" %}}
// ----