ggirelli / easy-webmention-js

A simple JavaScript library to serve Webmentions via Webmention.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

easy-webmention-js


A simple JavaScript library to serve Webmentions via Webmention.io

[ Live Demo ]

Requirements

This script requires jQuery v3.3.1+ and Bootstrap v5.0.2+.

Usage

Please, add the following in the <head /> of your pages, after importing Bootstrap and jQuery:

<script type="text/javascript" src="https://ggirelli.github.io/easy-webmention-js/src/easy-webmention.min.js"></script>

Then, place the following where you would like your webmentions to appear:

<!-- WEBMENTIONS -->
<div id="webmentions-wrap" class="border-top pt-2"></div>
<script type="text/javascript">
    $(function () {
        ew_init({
                      "tag" : "{{ site.webmentions.tag }}",       // Webmention.io username
                   "target" : "{{ site.url }}{{ page.url }}",     // This page's URL
            "read_more_uri" : "{{ site.webmentions.help_page }}", // URL to help page (optional)
                  "wrap_id" : "#webmentions-wrap"                 // ID of element where to add webmentions
        });
    });
</script>

About

A simple JavaScript library to serve Webmentions via Webmention.io

License:MIT License


Languages

Language:JavaScript 100.0%