Add Snaglist to a website
How-to
Add the 'Send feedback' button to every page of a website with one file and one line. The set-up tool writes this code for you, with your choices. This suits plain HTML sites, WordPress themes, server-rendered apps and anything else that has HTML pages.
Before you begin
- You can change your site's files and the HTML that every page shares, such as a layout or footer template.
- Decide where reports should go: Send reports to GitHub, Send reports by email or Send reports to your own server.
Steps
- Download
snaglist.jsfrom the Snaglist repository. This command saves it in the current folder:
curl -fsSLO https://raw.githubusercontent.com/TheMightyTRex/snaglist/main/snaglist.js
- Put
snaglist.jsin the folder your site serves files from, next to your other scripts. - Add this line to the shared HTML, immediately before
</body>. Put your GitHub repository in place ofowner/repo:
<script src="/snaglist.js" data-github="owner/repo" defer></script>
- Publish the site and open any page. You will find Send feedback in a corner of the page.
- Make a test report: Report a problem with one thing on a page.
Things to note
- For more settings than the script tag allows, start Snaglist yourself:
<script src="/snaglist.js"></script>
<script>
Snaglist.start({ app: "My site", version: "1.0.0", send: { github: { repo: "owner/repo" } } });
</script>
- Snaglist reads nothing until someone selects 'Send feedback', and sends nothing until they choose to.
- To serve the file from your own server with the right headers, read Host Snaglist on your own server.
If it does not work
Read If Send feedback does not appear.